Page MenuHomePhorge

User entitlements management
ClosedPublic

Authored by machniak on Mar 12 2020, 3:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 28, 3:01 AM
Unknown Object (File)
Feb 22 2024, 9:28 AM
Unknown Object (File)
Feb 17 2024, 7:08 AM
Unknown Object (File)
Feb 7 2024, 7:38 AM
Unknown Object (File)
Feb 1 2024, 2:14 PM
Unknown Object (File)
Jan 29 2024, 3:12 PM
Unknown Object (File)
Jan 28 2024, 10:15 PM
Unknown Object (File)
Jan 28 2024, 2:15 AM
Subscribers
None

Details

Summary

Make packages and SKUs name+description localizable
Add package and sku controllers
User entitlements UI and API

TODO: browser tests and more feature tests

Diff Detail

Repository
rK kolab
Branch
dev/entitlements-ui
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 28525
Build 10228: arc lint + arc unit

Event Timeline

machniak created this revision.
  • Use Queue:: syntax, phpstan is now happy

The following test seems to fail;

$ vendor/bin/phpunit tests/Feature/Controller/DomainsTest.php 
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Error:         No code coverage driver is available

F.F                                                                 3 / 3 (100%)

Time: 354 ms, Memory: 28.00 MB

There were 2 failures:

1) Tests\Feature\Controller\DomainsTest::testConfirm
Expected status code 200 but received 500.
Failed asserting that false is true.

/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:151
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Feature/Controller/DomainsTest.php:58

2) Tests\Feature\Controller\DomainsTest::testShow
Expected status code 200 but received 500.
Failed asserting that false is true.

/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:151
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Feature/Controller/DomainsTest.php:141

FAILURES!
Tests: 3, Assertions: 10, Failures: 2.

Because;

[2020-03-13 09:14:29] testing.DEBUG: [SQL] select * from `skus` where `skus`.`id` = ? limit 1 [2a1bb8ed-cda5-46d4-8142-c4d546b075b2]  
[2020-03-13 09:14:29] testing.ERROR: Sku not active  
[2020-03-13 09:14:29] testing.DEBUG: [SQL] select * from `domains` where `domains`.`id` = ? and `domains`.`deleted_at` is null limit 1 [1069549980]  
[2020-03-13 09:14:29] testing.DEBUG: [SQL] select * from `entitlements` where `entitlements`.`entitleable_id` = ? and `entitlements`.`entitleable_id` is not null and `entitlements`.`entitleable_type` = ? and `entitlements`.`deleted_at` is null limit 1 [1069549980, App\Domain]  
[2020-03-13 09:14:29] testing.ERROR: Trying to get property 'wallet' of non-object {"userId":1317732949,"exception":"[object] (ErrorException(code: 0): Trying to get property 'wallet' of non-object at /home/vanmeeuwen/devel/src/apheleia/kolab.git/src/app/Domain.php:348)
[stacktrace]
#0 /home/vanmeeuwen/devel/src/apheleia/kolab.git/src/app/Domain.php(348): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to get p...', '/home/vanmeeuwe...', 348, Array)
#1 /home/vanmeeuwen/devel/src/apheleia/kolab.git/src/app/User.php(252): App\\Domain->wallet()
#2 /home/vanmeeuwen/devel/src/apheleia/kolab.git/src/app/Http/Controllers/API/DomainsController.php(115): App\\User->canRead(Object(App\\Domain))
#3 [internal function]: App\\Http\\Controllers\\API\\DomainsController->show('1069549980')

It seems that an unchanged file src/tests/Feature/Controller/DomainTest.php is using the domain SKU and not the domain-hosting SKU.

This revision now requires changes to proceed.Mar 13 2020, 10:18 AM
  • Add browser tests, fix small issues
This revision is now accepted and ready to land.Mar 13 2020, 11:35 AM
This revision was automatically updated to reflect the committed changes.