/** * @since 2.5 * * @param integer|stdClass $id */ public function executeWith($id) { if (is_int($id)) { return $this->propertyTableIdReferenceDisposer->cleanUpTableEntriesById($id); } $this->propertyTableIdReferenceDisposer->cleanUpTableEntriesByRow($id); }
public function testcCleanUpTableEntriesByRow() { $row = new \stdClass(); $row->smw_id = 42; $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock(); $connection->expects($this->atLeastOnce())->method('delete'); $this->store->expects($this->any())->method('getConnection')->will($this->returnValue($connection)); $this->store->expects($this->any())->method('getPropertyTables')->will($this->returnValue(array())); $instance = new PropertyTableIdReferenceDisposer($this->store); $instance->cleanUpTableEntriesByRow($row); }