eZ\Publish\Core\Persistence\Legacy\Tests\User\Role\Gateway\DoctrineDatabaseTest::testCreateRole PHP Method

testCreateRole() public method

public testCreateRole ( )
    public function testCreateRole()
    {
        $gateway = $this->getDatabaseGateway();
        $spiRole = new Role(['identifier' => 'new_role', 'status' => Role::STATUS_DRAFT]);
        $gateway->createRole($spiRole);
        $query = $this->getDatabaseHandler()->createSelectQuery();
        $this->assertQueryResult([['id' => '6', 'name' => 'new_role', 'version' => -1]], $query->select('id', 'name', 'version')->from('ezrole')->where($query->expr->eq('name', $query->bindValue('new_role'))));
    }