コード例 #1
0
 public function testAssociateMultiColumnPrimaryKey()
 {
     $album = new Album(1);
     $certification_level = new CertificationLevel();
     $certification_level->setName('Gold');
     $certification = new Certification();
     $certification->setAlbumId($album->getAlbumId());
     $certification->setYear(2010);
     $certification_level->associateCertifications($certification);
     $certification_level->store();
     $this->assertEquals(array(array('name' => 'Gold')), self::$db->query('SELECT * FROM certification_levels')->fetchAllRows());
     $this->assertEquals(array(array('level' => 'Gold', 'album_id' => 1, 'year' => '2010')), self::$db->query('SELECT %r, album_id, year FROM certifications', 'level')->fetchAllRows());
 }