Ejemplo n.º 1
0
 /**
  * @covers ::__construct
  */
 public function testConstruct()
 {
     $city = new City();
     $this->assertTrue($city->isPending());
     $city = new City([], State::DELETED);
     $this->assertTrue($city->isDeleted());
     $city = new City(['name' => 'test', 'id' => 3]);
     $this->assertEquals('test', $city->name);
     $this->assertEquals(3, $city->id);
 }
Ejemplo n.º 2
0
 /**
  * @covers ::delete
  */
 public function testDelete()
 {
     $model = new City(null, State::SAVED);
     $this->assertFalse($model->isDeleted());
     $model->delete();
     $this->assertTrue($model->isDeleted());
     $model = new City(null, State::VOID);
     $this->assertFalse($model->isDeleted());
     $model->delete();
     $this->assertFalse($model->isDeleted(), 'Should not delete if void');
 }