コード例 #1
0
 public function testDelete()
 {
     $mapper = new \IBL\RotationMapper($this->_conn);
     $rotation = new \IBL\Rotation();
     $rotation->setWeek(29);
     $rotation->setRotation('Huey, Dewey, Louie');
     $rotation->setFranchiseId(0);
     $mapper->save($rotation);
     $deleteRotation = $mapper->findById($rotation->getId());
     $mapper->delete($deleteRotation);
     $checkRotation = $mapper->findById($rotation->getId());
     $this->assertFalse($checkRotation);
 }
コード例 #2
0
 public function testSaveUpdatesDatabase()
 {
     $mapper = new \IBL\RotationMapper($this->_conn);
     $rotation = new \IBL\Rotation();
     $rotation->setWeek(29);
     $rotation->setRotation('Huey, Dewey, Louie');
     $rotation->setFranchiseId(0);
     $mapper->save($rotation);
     $rotation2 = $mapper->findById($rotation->getId());
     $this->assertEquals($rotation->getId(), $rotation2->getId());
     $mapper->delete($rotation);
     $mapper = new \IBL\RotationMapper($this->_conn);
     $rotation = new \IBL\Rotation();
     $rotation->setWeek(30);
     $rotation->setRotation("Curly, Larry, Moe");
     $rotation->setFranchiseId(0);
     $mapper->save($rotation);
     $rotation->setRotation("Shemp, Larry, Moe");
     $mapper->save($rotation);
     $rotation2 = $mapper->findById($rotation->getId());
     $this->assertEquals("Shemp, Larry, Moe", $rotation2->getRotation());
     $mapper->delete($rotation);
 }