Created
March 17, 2021 05:35
-
-
Save chillbits-legacy/4e83e28e59e8685c97076a63810601f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature\Cart; | |
use Bree\Features\Cart\MaybeAddBoxesToCart; | |
use Tests\TestCase; | |
use Mockery as m; | |
use function Bree\boot_without_features; | |
/** | |
* @runInSeparateProcess | |
* @preserveGlobalState disabled | |
*/ | |
class AddBoxesToCartTest extends TestCase | |
{ | |
/** | |
* @var MaybeAddBoxesToCart | |
*/ | |
protected MaybeAddBoxesToCart $feature; | |
public function setUp(): void | |
{ | |
parent::setUp(); | |
$this->bootFeature(); | |
$this->feature->__invoke(); | |
do_action('bree_after_item_added_to_cart'); | |
} | |
private function bootFeature() | |
{ | |
boot_without_features(); | |
$this->feature = new MaybeAddBoxesToCart; | |
} | |
public function test_the_feature_should_run_after_an_item_added_to_cart() | |
{ | |
$this->assertSame( | |
10, | |
has_action( | |
'bree_after_item_added_to_cart', | |
'Bree\Features\Cart\MaybeAddBoxesToCart->process()' | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment