Esempio n. 1
0
 /**
  * testDeleteBoatBLinks method
  *
  * @return void
  */
 public function testDeleteBoatBLinks()
 {
     $this->loadFixtures('Boat', 'boatsTag', 'Tag', 'User');
     $TestModel = new BoatB();
     $result = $TestModel->boatsTag->find('all');
     $expected = array(array('boatsTag' => array('article_id' => '1', 'tag_id' => '1')), array('boatsTag' => array('article_id' => '1', 'tag_id' => '2')), array('boatsTag' => array('article_id' => '2', 'tag_id' => '1')), array('boatsTag' => array('article_id' => '2', 'tag_id' => '3')));
     $this->assertEquals($expected, $result);
     $TestModel->delete(1);
     $result = $TestModel->boatsTag->find('all');
     $expected = array(array('boatsTag' => array('article_id' => '2', 'tag_id' => '1')), array('boatsTag' => array('article_id' => '2', 'tag_id' => '3')));
     $this->assertEquals($expected, $result);
 }
Esempio n. 2
0
 public function test_checkNegation()
 {
     $boat = new BoatB(2);
     $this->assertEqual(true, $boat->setAge(18));
     $this->assertEqual(false, $boat->setAge(19));
 }
Esempio n. 3
0
 /**
  * Tests that creating a model with no existent database table associated will throw an exception
  *
  * @expectedException MissingTableException
  * @return void
  */
 public function testMissingTable()
 {
     $Boat = new BoatB(false, uniqid());
     $Boat->schema();
 }