Example #1
0
 /**
  * @covers ::getChanges
  */
 public function testGetChanges()
 {
     $object = new City(['id' => 10, 'name' => 'test1']);
     $this->assertEmpty($object->getChanges());
     $object->name = 'new val';
     $expected = ['name' => 'new val'];
     $this->assertEquals($expected, $object->getChanges());
     $object->id = 20;
     $expected = ['name' => 'new val', 'id' => 20];
     $this->assertEquals($expected, $object->getChanges());
     $object->name = 'test1';
     $object->id = 10;
     $this->assertEmpty($object->getChanges());
 }