/** * @test */ public function gets_and_sets_the_decision_details_on_the_new_object() { $referenceFoundInSession = new ReferencingApplication(); // Set up the necessary scenarios for finding a valid reference in the session... $this->mockSessionHolder->expects($this->once())->method('getReferenceFromSession')->willReturn($referenceFoundInSession); // And assert that 'getDecisionDetails' will be called on the $decisionDetailsRetriever... $this->mockDecisionDetailsRetriever->expects($this->once())->method('getDecisionDetails')->with($referenceFoundInSession)->willReturn(new ReferencingDecisionDetails()); // And also assert that 'setDecisionDetails' will be called on the RentRecoveryPlusReference object. $this->mockRentRecoveryPlusReference->method('setParent')->will($this->returnSelf()); $this->mockRentRecoveryPlusReference->expects($this->once())->method('setDecisionDetails'); // Trigger the test $transformer = new ReferenceNumberToReferenceObjectTransformer($this->mockDecisionDetailsRetriever, $this->mockSessionHolder, $this->mockRentRecoveryPlusReference); $transformer->reverseTransform('HLT999'); }
/** * @test * @dataProvider getInvalidInsightInvalidEnhanceValidOptimumCombinations */ public function transforms_invalid_insight_and_invalid_enhance_and_valid_optimum_into_optimum(array $references) { $this->mockSessionHolder->method('getReferencesFromSession')->willReturn($references); $transformer = new ReferenceToProductTypeTransformer($this->mockSessionHolder); $this->assertEquals('Optimum', $transformer->reverseTransform('HomeLetReference')); }