Skip to content

Commit

Permalink
test: update entry test
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 23, 2023
1 parent cc06e06 commit d665b27
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/Unit/EntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@

namespace MyParcelNL\PrestaShop;

use MyParcelNL\Pdk\Facade\Pdk;
use MyParcelNL\PrestaShop\Tests\Uses\UsesMockPlugin;
use Throwable;
use function MyParcelNL\Pdk\Tests\usesShared;
use function Spatie\Snapshots\assertMatchesJsonSnapshot;

usesShared(new UsesMockPlugin());

it('boots plugin', function () {
expect(true)->toBeTrue();
});

it('has hooks', function () {
assertMatchesJsonSnapshot(json_encode(Pdk::get('moduleHooks')));
});

it('installs and uninstalls module', function () {
/** @var \MyParcelNL $module */
$module = Pdk::get('moduleInstance');

expect($module->install())
->not->toThrow(Throwable::class)
->and($module->uninstall())
->not->toThrow(Throwable::class);
});
16 changes: 16 additions & 0 deletions tests/__snapshots__/EntryTest__it_has_hooks__1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
"displayBeforeCarrier",
"displayCarrierExtraContent",
"actionCarrierProcess",
"actionOrderGridDefinitionModifier",
"actionOrderGridPresenterModifier",
"actionObjectCustomerMessageAddAfter",
"displayAdminOrderMain",
"actionProductUpdate",
"displayAdminProductsExtra",
"displayAdminAfterHeader",
"displayAdminEndContent",
"displayBackOfficeHeader",
"displayHeader",
"actionCarrierUpdate"
]

0 comments on commit d665b27

Please sign in to comment.