Dumplie\SharedKernel\Tests\Integration\Application\InMemory\CommandExtensionTest::test_extension_execution_without_specified_order PHP Метод

test_extension_execution_without_specified_order() публичный Метод

    public function test_extension_execution_without_specified_order()
    {
        $command = new CreateCart((string) CartId::generate(), 'PLN');
        $executionOrder = [];
        $prePromise = function () use(&$executionOrder) {
            $executionOrder[] = spl_object_hash($this);
        };
        $extension1 = $this->createExtensionProphecy($command, $prePromise);
        $extension2 = $this->createExtensionProphecy($command, $prePromise);
        $this->extensionRegistry->register($extension1->reveal());
        $this->extensionRegistry->register($extension2->reveal());
        $this->extensionRegistry->pre($command);
        $this->assertEquals([spl_object_hash($extension1), spl_object_hash($extension2)], $executionOrder);
    }