<commit_before><?php

namespace Test\Delegate;

require_once __DIR__ . '/../../../vendor/autoload.php';

use Halfpastfour\PHPChartJS\Delegate\ArraySerializable;


/**
 * Class ArraySerializableTest
 * @package Test\Delegate
 */
class ArraySerializableTest extends \PHPUnit_Framework_TestCase
{
	/**
	 * @var A
	 */
	private $classA;

	/**
	 * @var B
	 */
	private $classB;

	/**
	 *
	 */
	public function setUp() {
		$this->classA = new A(1, 2);
		$this->classB = new B(3, 4, 5, 6);
	}

	/**
	 *
	 */
	public function testSuperclass() {
		$expected = ['a' => 1, 'b' => 2];
		ksort($expected);
		$result = $this->classA->getArrayCopy();
		ksort($result);
		self::assertSame($expected, $result);
	}

	/**
	 *
	 */
	public function testSubclass() {
		$expected = ['a' => 3, 'b' => 4, 'c' => 5, 'd' => 6];
		ksort($expected);
		$result = $this->classB->getArrayCopy();
		ksort($result);
		self::assertSame($expected, $result);
	}

}

/**
 * Class A
 * @package Delegate
 */
class A
{
	use ArraySerializable;

	/**
	 * @var int
	 */
	private $a;

	/**
	 * @var int
	 */
	private $b;

	/**
	 * A constructor.
	 *
	 * @param $a int
	 * @param $b int
	 */
	public function __construct( $a, $b)
	{
		$this->a = $a;
		$this->b = $b;
	}

	/**
	 * @return int
	 */
	public function getA()
	{
		return $this->a;
	}

	/**
	 * @param int $a
	 */
	public function setA( $a )
	{
		$this->a = $a;
	}

	/**
	 * @return int
	 */
	public function getB()
	{
		return $this->b;
	}

	/**
	 * @param int $b
	 */
	public function setB( $b )
	{
		$this->b = $b;
	}

}

/**
 * Class B
 * @package Delegate
 */
class B extends A
{
	/**
	 * @var int
	 */
	private $c;

	/**
	 * @var int
	 */
	private $d;

	/**
	 * B constructor.
	 *
	 * @param $a int
	 * @param $b int
	 * @param $c int
	 * @param $d int
	 */
	public function __construct( $a, $b, $c, $d )
	{
		parent::__construct( $a, $b );
		$this->c = $c;
		$this->d = $d;
	}

	/**
	 * @return int
	 */
	public function getC()
	{
		return $this->c;
	}

	/**
	 * @param int $c
	 */
	public function setC( $c )
	{
		$this->c = $c;
	}

	/**
	 * @return int
	 */
	public function getD()
	{
		return $this->d;
	}

	/**
	 * @param int $d
	 */
	public function setD( $d )
	{
		$this->d = $d;
	}
}
<commit_msg>Additional testsituation for #32.<commit_after><?php

namespace Test\Delegate;

require_once __DIR__ . '/../../../vendor/autoload.php';

use Halfpastfour\PHPChartJS\Delegate\ArraySerializable;

/**
 * Class ArraySerializableTest
 * @package Test\Delegate
 */
class ArraySerializableTest extends \PHPUnit_Framework_TestCase
{
	/**
	 * @var A
	 */
	private $classA;

	/**
	 * @var B
	 */
	private $classB;

	/**
	 *
	 */
	public function setUp()
	{
		$this->classA = new A( 1, 2 );
		$this->classB = new B( 3, 4, 5, 6 );
	}

	/**
	 *
	 */
	public function testSuperclass()
	{
		$expected = [ 'a' => 1, 'b' => 2 ];
		ksort( $expected );
		$result = $this->classA->getArrayCopy();
		ksort( $result );
		self::assertSame( $expected, $result );
	}

	/**
	 *
	 */
	public function testSubclass()
	{
		$expected = [ 'a' => 3, 'b' => 4, 'c' => 5, 'd' => 6 ];
		ksort( $expected );
		$result = $this->classB->getArrayCopy();
		ksort( $result );
		self::assertSame( $expected, $result );
	}
}

/**
 * Class A
 * @package Delegate
 */
class A
{
	use ArraySerializable;

	/**
	 * @var int
	 */
	private $a;

	/**
	 * @var int
	 */
	private $b;

	/**
	 * @var int
	 */
	private $x;

	/**
	 * @var int
	 */
	private $y;

	/**
	 * A constructor.
	 *
	 * @param $a int
	 * @param $b int
	 */
	public function __construct( $a, $b )
	{
		$this->a = $a;
		$this->b = $b;
	}

	/**
	 * @return int
	 */
	public function getA()
	{
		return $this->a;
	}

	/**
	 * @param int $a
	 */
	public function setA( $a )
	{
		$this->a = $a;
	}

	/**
	 * @return int
	 */
	public function getB()
	{
		return $this->b;
	}

	/**
	 * @param int $b
	 */
	public function setB( $b )
	{
		$this->b = $b;
	}

	/**
	 * @return int
	 */
	public function X()
	{
		return $this->x;
	}

	/**
	 * this method should never be called by jsonSerialize because it is not
	 * a boolean.
	 *
	 * @return int
	 */
	public function isY()
	{
		return $this->y;
	}
}

/**
 * Class B
 * @package Delegate
 */
class B extends A
{
	/**
	 * @var int
	 */
	private $c;

	/**
	 * @var int
	 */
	private $d;

	/**
	 * B constructor.
	 *
	 * @param $a int
	 * @param $b int
	 * @param $c int
	 * @param $d int
	 */
	public function __construct( $a, $b, $c, $d )
	{
		parent::__construct( $a, $b );
		$this->c = $c;
		$this->d = $d;
	}

	/**
	 * @return int
	 */
	public function getC()
	{
		return $this->c;
	}

	/**
	 * @param int $c
	 */
	public function setC( $c )
	{
		$this->c = $c;
	}

	/**
	 * @return int
	 */
	public function getD()
	{
		return $this->d;
	}

	/**
	 * @param int $d
	 */
	public function setD( $d )
	{
		$this->d = $d;
	}
}

{'fraction_non_alphanumeric': 0.2074844074844075, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 2.2727891156462583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '2130751', 'n_tokens_mistral': 2160, 'n_tokens_neox': 1938, 'n_words': 467}