You are here

public function TimeEfficientImplementationTest::testIsStrictComparison in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php \SebastianBergmann\Diff\LCS\TimeEfficientImplementationTest::testIsStrictComparison()

File

vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php, line 46

Class

TimeEfficientImplementationTest
Some of these tests are volontary stressfull, in order to give some approximative benchmark hints.

Namespace

SebastianBergmann\Diff\LCS

Code

public function testIsStrictComparison() {
  $from = array(
    false,
    0,
    0.0,
    '',
    null,
    array(),
    true,
    1,
    1.0,
    'foo',
    array(
      'foo',
      'bar',
    ),
    array(
      'foo' => 'bar',
    ),
  );
  $to = $from;
  $common = $this->implementation
    ->calculate($from, $to);
  $this
    ->assertEquals($from, $common);
  $to = array(
    false,
    false,
    false,
    false,
    false,
    false,
    true,
    true,
    true,
    true,
    true,
    true,
  );
  $expected = array(
    false,
    true,
  );
  $common = $this->implementation
    ->calculate($from, $to);
  $this
    ->assertEquals($expected, $common);
}