/**
  * Ensure that if the id key is null but present the save doesn't fail (with an
  * x sql error: "Column id specified twice")
  *
  * @return void
  */
 public function testSaveUuidNull()
 {
     // SQLite does not support non-integer primary keys
     $this->skipIf($this->db instanceof Sqlite, 'This test is not compatible with SQLite.');
     $this->loadFixtures('Uuid');
     $TestModel = new Uuid();
     $TestModel->save(array('title' => 'Test record', 'id' => null));
     $result = $TestModel->findByTitle('Test record');
     $this->assertEquals(array('id', 'title', 'count', 'created', 'updated'), array_keys($result['Uuid']));
     $this->assertEquals(36, strlen($result['Uuid']['id']));
 }
Beispiel #2
0
 /**
  * Ensure that if the id key is null but present the save doesn't fail (with an
  * x sql error: "Column id specified twice")
  *
  * @return void
  */
 public function testSaveUuidNull()
 {
     // SQLite does not support non-integer primary keys
     $this->skipIf($this->db->config['driver'] == 'sqlite');
     $this->loadFixtures('Uuid');
     $TestModel = new Uuid();
     $TestModel->save(array('title' => 'Test record', 'id' => null));
     $result = $TestModel->findByTitle('Test record');
     $this->assertEqual(array_keys($result['Uuid']), array('id', 'title', 'count', 'created', 'updated'));
     $this->assertEqual(strlen($result['Uuid']['id']), 36);
 }