eZ\Publish\Core\Persistence\Legacy\Tests\User\UserHandlerTest::testDeleteRoleDraft PHP Method

testDeleteRoleDraft() public method

public testDeleteRoleDraft ( )
    public function testDeleteRoleDraft()
    {
        $this->insertDatabaseFixture(__DIR__ . '/../../../../Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php');
        $handler = $this->getUserHandler();
        // 3 is the ID of Editor role
        $roleDraft = $handler->createRoleDraft(3);
        $handler->deleteRole($roleDraft->id, APIRole::STATUS_DRAFT);
        $this->assertQueryResult([['3', APIRole::STATUS_DEFINED]], $this->handler->createSelectQuery()->select('id, version')->from('ezrole')->where('id = 3'), 'Expected a published role.');
        $this->assertQueryResult([[implode("\n", array_fill(0, 27, '3, ' . APIRole::STATUS_DEFINED))]], $this->handler->createSelectQuery()->select('role_id, original_id')->from('ezpolicy')->where('role_id = 3'), 'Expected 27 policies for the published role.');
        $this->assertQueryResult([[3], [3]], $this->handler->createSelectQuery()->select('role_id')->from('ezuser_role')->where('role_id = 3'), 'Expected that role assignments still exist.');
    }