public function testDeleteByInstance() { $dao = new OwnerInstanceMySQLDAO(); $builder1 = FixtureBuilder::build(self::TEST_TABLE_OI, array('instance_id' => 20, 'owner_id' => 50)); $builder2 = FixtureBuilder::build(self::TEST_TABLE_OI, array('instance_id' => 20, 'owner_id' => 51)); $builder3 = FixtureBuilder::build(self::TEST_TABLE_OI, array('instance_id' => 20, 'owner_id' => 52)); $owner_instance = $dao->get(50, 20); $this->assertNotNull($owner_instance); $owner_instance = $dao->get(51, 20); $this->assertNotNull($owner_instance); $owner_instance = $dao->get(52, 20); $this->assertNotNull($owner_instance); $result = $dao->deleteByInstance(20); $this->assertEqual($result, 3); $owner_instance = $dao->get(50, 20); $this->assertNull($owner_instance); $owner_instance = $dao->get(51, 20); $this->assertNull($owner_instance); $owner_instance = $dao->get(52, 20); $this->assertNull($owner_instance); }