コード例 #1
0
 /**
  * @covers ::isEmptyChanges
  * @covers ::isChanged
  */
 public function testChanged()
 {
     $object = new City(['id' => 10, 'name' => 'test1']);
     $this->assertTrue($object->isEmptyChanges());
     $this->assertFalse($object->isChanged());
     $object->name = 'new val';
     $this->assertFalse($object->isEmptyChanges());
     $this->assertTrue($object->isChanged());
     $object->id = 20;
     $this->assertFalse($object->isEmptyChanges());
     $this->assertTrue($object->isChanged());
     $object->name = 'test1';
     $object->id = 10;
     $this->assertTrue($object->isEmptyChanges());
     $this->assertFalse($object->isChanged());
 }