public function testRemoveMatch() { $this->assertEquals($this->object->count(), 0); $this->object->addMatch($this->match); $this->assertEquals($this->object->count(), 1); $res = $this->object->removeMatch($this->match); $this->assertTrue($res); $this->assertEquals($this->object->count(), 0); $res = $this->object->removeMatch($this->match); $this->assertFalse($res); $this->assertEquals($this->object->count(), 0); }
/** * removeMatch * * @param KVDthes_Match $match */ public function removeMatch(KVDthes_Match $match) { $this->checkMatches(); if ($this->matches->removeMatch($match)) { //verwijder de inverse relatie $match->getMatchable()->removeMatch(new KVDthes_Match($match->getInverseMatch(), $this)); $this->markDirty(); } }