eZ\Publish\Core\Persistence\Legacy\Tests\Content\Type\Gateway\DoctrineDatabaseTest::testDeleteFieldDefinitionsForTypeExisting PHP Method

testDeleteFieldDefinitionsForTypeExisting() public method

    public function testDeleteFieldDefinitionsForTypeExisting()
    {
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/existing_types.php');
        $gateway = $this->getGateway();
        $gateway->deleteFieldDefinitionsForType(1, 0);
        $countAffectedAttr = $this->getDatabaseHandler()->createSelectQuery();
        $countAffectedAttr->select('COUNT(*)')->from('ezcontentclass_attribute')->where($countAffectedAttr->expr->eq('contentclass_id', 1));
        // 1 left with version 1
        $this->assertQueryResult(array(array(1)), $countAffectedAttr);
        $countNotAffectedAttr = $this->getDatabaseHandler()->createSelectQuery();
        $countNotAffectedAttr->select('COUNT(*)')->from('ezcontentclass_attribute');
        $this->assertQueryResult(array(array(2)), $countNotAffectedAttr);
    }