You are here

protected function Framework_AssertTest::notEqualValues in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/tests/Framework/AssertTest.php \Framework_AssertTest::notEqualValues()
2 calls to Framework_AssertTest::notEqualValues()
Framework_AssertTest::notEqualProvider in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
Framework_AssertTest::notSameProvider in vendor/phpunit/phpunit/tests/Framework/AssertTest.php

File

vendor/phpunit/phpunit/tests/Framework/AssertTest.php, line 694

Class

Framework_AssertTest
@since Class available since Release 2.0.0

Code

protected function notEqualValues() {

  // cyclic dependencies
  $book1 = new Book();
  $book1->author = new Author('Terry Pratchett');
  $book1->author->books[] = $book1;
  $book2 = new Book();
  $book2->author = new Author('Terry Pratch');
  $book2->author->books[] = $book2;
  $book3 = new Book();
  $book3->author = 'Terry Pratchett';
  $book4 = new stdClass();
  $book4->author = 'Terry Pratchett';
  $object1 = new SampleClass(4, 8, 15);
  $object2 = new SampleClass(16, 23, 42);
  $object3 = new SampleClass(4, 8, 15);
  $storage1 = new SplObjectStorage();
  $storage1
    ->attach($object1);
  $storage2 = new SplObjectStorage();
  $storage2
    ->attach($object3);

  // same content, different object
  // cannot use $filesDirectory, because neither setUp() nor
  // setUpBeforeClass() are executed before the data providers
  $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml';
  return array(
    // strings
    array(
      'a',
      'b',
    ),
    array(
      'a',
      'A',
    ),
    // https://github.com/sebastianbergmann/phpunit/issues/1023
    array(
      '9E6666666',
      '9E7777777',
    ),
    // integers
    array(
      1,
      2,
    ),
    array(
      2,
      1,
    ),
    // floats
    array(
      2.3,
      4.2,
    ),
    array(
      2.3,
      4.2,
      0.5,
    ),
    array(
      array(
        2.3,
      ),
      array(
        4.2,
      ),
      0.5,
    ),
    array(
      array(
        array(
          2.3,
        ),
      ),
      array(
        array(
          4.2,
        ),
      ),
      0.5,
    ),
    array(
      new Struct(2.3),
      new Struct(4.2),
      0.5,
    ),
    array(
      array(
        new Struct(2.3),
      ),
      array(
        new Struct(4.2),
      ),
      0.5,
    ),
    // NAN
    array(
      NAN,
      NAN,
    ),
    // arrays
    array(
      array(),
      array(
        0 => 1,
      ),
    ),
    array(
      array(
        0 => 1,
      ),
      array(),
    ),
    array(
      array(
        0 => null,
      ),
      array(),
    ),
    array(
      array(
        0 => 1,
        1 => 2,
      ),
      array(
        0 => 1,
        1 => 3,
      ),
    ),
    array(
      array(
        'a',
        'b' => array(
          1,
          2,
        ),
      ),
      array(
        'a',
        'b' => array(
          2,
          1,
        ),
      ),
    ),
    // objects
    array(
      new SampleClass(4, 8, 15),
      new SampleClass(16, 23, 42),
    ),
    array(
      $object1,
      $object2,
    ),
    array(
      $book1,
      $book2,
    ),
    array(
      $book3,
      $book4,
    ),
    // same content, different class
    // resources
    array(
      fopen($file, 'r'),
      fopen($file, 'r'),
    ),
    // SplObjectStorage
    array(
      $storage1,
      $storage2,
    ),
    // DOMDocument
    array(
      PHPUnit_Util_XML::load('<root></root>'),
      PHPUnit_Util_XML::load('<bar/>'),
    ),
    array(
      PHPUnit_Util_XML::load('<foo attr1="bar"/>'),
      PHPUnit_Util_XML::load('<foo attr1="foobar"/>'),
    ),
    array(
      PHPUnit_Util_XML::load('<foo> bar </foo>'),
      PHPUnit_Util_XML::load('<foo />'),
    ),
    array(
      PHPUnit_Util_XML::load('<foo xmlns="urn:myns:bar"/>'),
      PHPUnit_Util_XML::load('<foo xmlns="urn:notmyns:bar"/>'),
    ),
    array(
      PHPUnit_Util_XML::load('<foo> bar </foo>'),
      PHPUnit_Util_XML::load('<foo> bir </foo>'),
    ),
    array(
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')),
    ),
    array(
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')),
      3500,
    ),
    array(
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-29 05:13:35', new DateTimeZone('America/New_York')),
      3500,
    ),
    array(
      new DateTime('2013-03-29', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-30', new DateTimeZone('America/New_York')),
    ),
    array(
      new DateTime('2013-03-29', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-30', new DateTimeZone('America/New_York')),
      43200,
    ),
    array(
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')),
    ),
    array(
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')),
      3500,
    ),
    array(
      new DateTime('2013-03-30', new DateTimeZone('America/New_York')),
      new DateTime('2013-03-30', new DateTimeZone('America/Chicago')),
    ),
    array(
      new DateTime('2013-03-29T05:13:35-0600'),
      new DateTime('2013-03-29T04:13:35-0600'),
    ),
    array(
      new DateTime('2013-03-29T05:13:35-0600'),
      new DateTime('2013-03-29T05:13:35-0500'),
    ),
    // Exception

    //array(new Exception('Exception 1'), new Exception('Exception 2')),

    // different types
    array(
      new SampleClass(4, 8, 15),
      false,
    ),
    array(
      false,
      new SampleClass(4, 8, 15),
    ),
    array(
      array(
        0 => 1,
        1 => 2,
      ),
      false,
    ),
    array(
      false,
      array(
        0 => 1,
        1 => 2,
      ),
    ),
    array(
      array(),
      new stdClass(),
    ),
    array(
      new stdClass(),
      array(),
    ),
    // PHP: 0 == 'Foobar' => true!
    // We want these values to differ
    array(
      0,
      'Foobar',
    ),
    array(
      'Foobar',
      0,
    ),
    array(
      3,
      acos(8),
    ),
    array(
      acos(8),
      3,
    ),
  );
}