You are here

public function ObjectComparatorTest::assertEqualsFailsProvider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/sebastian/comparator/tests/ObjectComparatorTest.php \SebastianBergmann\Comparator\ObjectComparatorTest::assertEqualsFailsProvider()

File

vendor/sebastian/comparator/tests/ObjectComparatorTest.php, line 69

Class

ObjectComparatorTest
@coversDefaultClass SebastianBergmann\Comparator\ObjectComparator

Namespace

SebastianBergmann\Comparator

Code

public function assertEqualsFailsProvider() {
  $typeMessage = 'is not instance of expected class';
  $equalMessage = 'Failed asserting that two objects are equal.';

  // 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);
  return array(
    array(
      new SampleClass(4, 8, 15),
      new SampleClass(16, 23, 42),
      $equalMessage,
    ),
    array(
      $object1,
      $object2,
      $equalMessage,
    ),
    array(
      $book1,
      $book2,
      $equalMessage,
    ),
    array(
      $book3,
      $book4,
      $typeMessage,
    ),
    array(
      new Struct(2.3),
      new Struct(4.2),
      $equalMessage,
      0.5,
    ),
  );
}