Elgg\Database\SubtypeTableTest::testCanRemoveSubtype PHP Method

testCanRemoveSubtype() public method

    public function testCanRemoveSubtype()
    {
        $dbprefix = elgg_get_config('dbprefix');
        $this->setupFetchAllQuery();
        $type = 'object';
        $subtype = 'foo';
        $this->db->addQuerySpec(['sql' => "\n\t\t\t\tDELETE FROM {$dbprefix}entity_subtypes\n\t\t\t\tWHERE type = :type AND subtype = :subtype\n\t\t\t", 'params' => [':type' => $type, ':subtype' => $subtype], 'row_count' => 1]);
        $this->assertTrue(_elgg_services()->subtypeTable->remove($type, $subtype));
        $this->db->addQuerySpec(['sql' => "\n\t\t\t\tDELETE FROM {$dbprefix}entity_subtypes\n\t\t\t\tWHERE type = :type AND subtype = :subtype\n\t\t\t", 'params' => [':type' => $type, ':subtype' => 'unregistered'], 'row_count' => 0]);
        $this->assertFalse(_elgg_services()->subtypeTable->remove($type, 'unregistered'));
    }