Exemplo n.º 1
0
 /**
  * test the insert method
  *
  * @access public
  * @return void
  */
 function testInsert()
 {
     $Fixture = new CakeTestFixtureTestFixture();
     $this->criticDb->setReturnValue('insertMulti', true);
     $this->criticDb->expectAtLeastOnce('insertMulti');
     $return = $Fixture->insert($this->criticDb);
     $this->assertTrue($this->criticDb->fullDebug);
     $this->assertTrue($return);
 }
 /**
  * test the insert method
  *
  * @return void
  */
 public function testInsert()
 {
     $Fixture = new CakeTestFixtureTestFixture();
     $this->criticDb->expects($this->atLeastOnce())->method('insertMulti')->will($this->returnCallback(array($this, 'insertCallback')));
     $return = $Fixture->insert($this->criticDb);
     $this->assertTrue(!empty($this->insertMulti));
     $this->assertTrue($this->criticDb->fullDebug);
     $this->assertTrue($return);
     $this->assertEquals('fixture_tests', $this->insertMulti['table']);
     $this->assertEquals(array('name', 'created'), $this->insertMulti['fields']);
     $expected = array(array('Gandalf', '2009-04-28 19:20:00'), array('Captain Picard', '2009-04-28 19:20:00'), array('Chewbacca', '2009-04-28 19:20:00'));
     $this->assertEquals($expected, $this->insertMulti['values']);
 }
Exemplo n.º 3
0
 /**
  * test the insert method
  *
  * @access public
  * @return void
  */
 function testInsert()
 {
     $Fixture = new CakeTestFixtureTestFixture();
     $this->criticDb->expects($this->atLeastOnce())->method('insertMulti')->will($this->returnValue(true));
     $return = $Fixture->insert($this->criticDb);
     $this->assertTrue($this->criticDb->fullDebug);
     $this->assertTrue($return);
 }