Dumplie\SharedKernel\Tests\Integration\Application\InMemory\Command\Extension\Core\TransactionExtensionTest::test_transaction_extension_rollback PHP Method

test_transaction_extension_rollback() public method

    public function test_transaction_extension_rollback()
    {
        $transaction = $this->prophesize(Transaction::class);
        $transaction->commit()->shouldNotBeCalled();
        $transaction->rollback()->shouldBeCalled();
        $factory = new FactoryStub($transaction->reveal());
        $transaction = new TransactionExtension($factory);
        $this->extensionRegistry->register($transaction);
        $this->expectException(ProductNotFoundException::class);
        $command = new AddToCart("SKU", 1, (string) CartId::generate());
        $this->commandBus->handle($command);
    }