<commit_before><?php namespace SEIDS\LinkedLists\Singly;
//==============================================================================
// PHP SEIDS: Supplementary, Easily Interchangeable Data Structures
// 
// Copyright 2015, <NAME>
// Distributed under the MIT License.
// (See LICENSE file for details.)
//==============================================================================

class ItemTest extends \PHPUnit_Framework_TestCase
{
	public function testConstructor()
	{
		$n = 3;
		
		$two = new Item(--$n);
		$one = new Item(--$n, $two);
		
		$this->assertEquals(1, $one->data);
		$this->assertEquals(2, $two->data);
		
		$this->assertEquals($two, $one->next);
		$this->assertNull($two->next);
	}
	
	public function testClone()
	{
		$n = 5;
		
		if(class_exists('SplInt')) $four  = new Item(new \SplInt(--$n));
		if(class_exists('SplInt')) $three = new Item(new \SplInt(--$n), $four);
		
		$two = new Item(--$n, $three);
		$one = new Item(--$n, $two);
		
		$one_clone = clone $one;
		
		$this->assertEquals($one->data, $one_clone->data);
		$this->assertEquals($one->next, $one_clone->next);
		
		$this->assertEquals($one->next->data, $one_clone->next->data);
		<commit_msg>Fix bug when spl_types is missing<commit_after><?php namespace SEIDS\LinkedLists\Singly;
//==============================================================================
// PHP SEIDS: Supplementary, Easily Interchangeable Data Structures
// 
// Copyright 2015, <NAME>
// Distributed under the MIT License.
// (See LICENSE file for details.)
//==============================================================================

class ItemTest extends \PHPUnit_Framework_TestCase
{
	public function testConstructor()
	{
		$n = 3;
		
		$two = new Item(--$n);
		$one = new Item(--$n, $two);
		
		$this->assertEquals(1, $one->data);
		$this->assertEquals(2, $two->data);
		
		$this->assertEquals($two, $one->next);
		$this->assertNull($two->next);
	}
	
	public function testClone()
	{
		$n     = 5;
		$three = null;
		
		if(class_exists('SplInt')) $four  = new Item(new \SplInt(--$n));
		if(class_exists('SplInt')) $three = new Item(new \SplInt(--$n), $four);
		
		$two = new Item(--$n, $three);
		$one = new Item(--$n, $two);
		
		$one_clone = clone $one;
		
		$this->assertEquals($one->data, $one_clone->data);
		$this->assertEquals($one->next, $one_clone->next);
		
		$this->assertEquals($one->next->data, $one_clone->next->data);
		
{'fraction_non_alphanumeric': 0.3021135515955242, 'fraction_numerical': 0.00663075010360547, 'mean_word_length': 4.328918322295806, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4659259', 'n_tokens_mistral': 871, 'n_tokens_neox': 742, 'n_words': 165}