tests/FirstPayment/Actions/StartSubscriptionTest.php
/**
     * Check if the action can be built using the payload, and then can return the same payload.
     *
     * @param array $overrides
     * @throws \Exception
     */
Check if the action can be built using the payload, and then can return the same payload.
@param array $overrides
@throws \Exception
Check if the action can be built using the payload and then can return the same payload . @param array $overrides @throws \ Exception
protected function assertFromPayloadToPayload($overrides = [])
    {
        $payload = array_filter(array_merge([
            'handler' => StartSubscription::class,
            'description' => 'Monthly payment',
            'subtotal' => [
                'value' => '10.00',
                'currency' => 'EUR',
            ],
            'taxPercentage' => 20,
            'plan' => 'monthly-10-1',
            'name' => 'default',
            'quantity' => 1,
        ], $overrides));
        $action = StartSubscription::createFromPayload(
            $payload,
            $this->getMandatedUser()
        );
        $result = $action->getPayload();
        $this->assertEquals($payload, $result);
    }
protected function assertFromPayloadToPayload ( $ overrides = [ ] ) { $ payload = array_filter ( array_merge ( [ 'handler' => StartSubscription :: class , 'description' => 'Monthly payment' , 'subtotal' => [ 'value' => '10.00' , 'currency' => 'EUR' , ] , 'taxPercentage' => 20 , 'plan' => 'monthly-10-1' , 'name' => 'default' , 'quantity' => 1 , ] , $ overrides ) ) ; $ action = StartSubscription :: createFromPayload ( $ payload , $ this -> getMandatedUser ( ) ) ; $ result = $ action -> getPayload ( ) ; $ this -> assertEquals ( $ payload , $ result ) ; }
Check if the action can be built using the payload, and then can return the same payload.
Check if the action can be built using the payload and then can return the same payload .