Ejemplo n.º 1
0
 public function testAssertNoDifferenceFalse()
 {
     try {
         $diff = $this->assertNoDifference('UnitTest::count()');
         UnitTest::create(array('string_value' => 'foo bar', 'integer_value' => 12345, 'email_value' => '*****@*****.**'));
         $diff->end();
     } catch (Exception $e) {
     }
     $this->assertTrue($e instanceof PHPUnit_Framework_AssertionFailedError);
 }
Ejemplo n.º 2
0
 public function testSaveInsertZeroOnPrimaryKey()
 {
     $test = UnitTest::create(array('id' => 0, 'integer_value' => 123, 'string_value' => 'asdf', 'email_value' => '*****@*****.**'));
     $this->assertFalse(UnitTest::exists(0));
     $test = UnitTest::find('first', array('conditions' => "string_value = 'asdf'"));
     $this->assertInstanceOf('UnitTest', $test);
 }