tests/Training/Services/Subscription/SubscriptionServiceTest.php
/**
     * @dataProvider getDataForTest
     * @param Subscription $subscription
     * @param $expectedResult
     */
@dataProvider getDataForTest
@param Subscription $subscription
@param $expectedResult
@dataProvider getDataForTest @param Subscription $subscription @param $expectedResult
public function testExecute(Subscription $subscription, $expectedResult) {
        $this->logger->info(sprintf("Testing the method %s with parameters: %s", __METHOD__, json_encode($subscription)));
        $this->service->setSubscription($subscription);
        $result = false;
        if ($this->service->validate($subscription)) {
            $result = $this->service->execute();
        }
        self::assertEquals($result, $expectedResult);
    }
public function testExecute ( Subscription $ subscription , $ expectedResult ) { $ this -> logger -> info ( sprintf ( " Testing the method %s with parameters: %s " , __METHOD__ , json_encode ( $ subscription ) ) ) ; $ this -> service -> setSubscription ( $ subscription ) ; $ result = false ; if ( $ this -> service -> validate ( $ subscription ) ) { $ result = $ this -> service -> execute ( ) ; } self :: assertEquals ( $ result , $ expectedResult ) ; }
@dataProvider getDataForTest
 @param Subscription $subscription
 @param $expectedResult
@dataProvider getDataForTest @param Subscription $subscription @param $expectedResult