You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there,
i'm having trouble using Laravel-ACL's getRoles() in my Codeception tests. I can't figure out if it's a Laravel-ACL specific limit or it's related to the application handling in Codeception.
Here's the test i wrote:
$I = newFeatureTester($scenario);
$I->wantTo('see that Kodeine ACL works with Codeception');
// setup$user = newUser([
'first_name' => 'Test',
'last_name' => 'User',
'email' => '[email protected]',
'password' => 'reallysafe',
]);
$user->save();
$I->expect('that assignRole() works');
$user->assignRole('user');
$I->amGoingTo('verify if the role has been assigned in the db');
$user_role = Role::where('slug', 'user')->first();
$I->seeRecord('role_user', ['role_id' => $user_role->id, 'user_id' => $user->id]);
$I->expect('that getRoles returns "user"');
$I->assertEquals(['user'], $user->getRoles());
And this is the result
$ codecept run feature Kodeine_ACL_Cept.php
Codeception PHP Testing Framework v2.2.9
Powered by PHPUnit 5.7.14 by Sebastian Bergmann and contributors.
There was 1 failure:
1) Kodeine_ACL_Cept: See that kodeine acl works with codeception
Test tests/feature/Kodeine_ACL_Cept.php
Step Assert equals ["user"],[]
Fail Failed asserting that two arrays are equal.
- Expected | + Actual
@@ @@
Array (
- 0 =>'user'
)
Scenario Steps:
5. $I->assertEquals(["user"],[]) at tests/feature/Kodeine_ACL_Cept.php:27
4. // I expect that getRoles returns "user"
3. $I->seeRecord("role_user",{"role_id":7,"user_id":49}) at tests/feature/Kodeine_ACL_Cept.php:24
2. // I am going to verify if the role has been assigned in the db
1. // I expect that assignRole() works
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
I am using the Laravel5 and Asserts helpers.
The text was updated successfully, but these errors were encountered:
Hello there,
i'm having trouble using Laravel-ACL's
getRoles()
in my Codeception tests. I can't figure out if it's a Laravel-ACL specific limit or it's related to the application handling in Codeception.Here's the test i wrote:
And this is the result
I am using the
Laravel5
andAsserts
helpers.The text was updated successfully, but these errors were encountered: