/** * Check the getInputs method */ public function testGetInputsFalse() { $stubTranslator = $this->getMockBuilder('\\Thelia\\Core\\Translation\\Translator')->disableOriginalConstructor()->getMock(); /** @var FacadeInterface $stubFacade */ $stubFacade = $this->getMockBuilder('\\Thelia\\Coupon\\BaseFacade')->disableOriginalConstructor()->getMock(); $stubFacade->expects($this->any())->method('getTranslator')->will($this->returnValue($stubTranslator)); $stubFacade->expects($this->any())->method('getConditionEvaluator')->will($this->returnValue(new ConditionEvaluator())); $currencies = CurrencyQuery::create(); $currencies = $currencies->find(); $stubFacade->expects($this->any())->method('getAvailableCurrencies')->will($this->returnValue($currencies)); $stubContainer = $this->getMockBuilder('\\Symfony\\Component\\DependencyInjection\\Container')->disableOriginalConstructor()->getMock(); $condition1 = new MatchForTotalAmount($stubFacade); $stubContainer->expects($this->any())->method('get')->will($this->returnValue($condition1)); $stubContainer->expects($this->any())->method('has')->will($this->returnValue(false)); $stubFacade->expects($this->any())->method('getContainer')->will($this->returnValue($stubContainer)); $operators = array(MatchForTotalAmount::CART_TOTAL => Operators::SUPERIOR, MatchForTotalAmount::CART_CURRENCY => Operators::EQUAL); $values = array(MatchForTotalAmount::CART_TOTAL => 40.0, MatchForTotalAmount::CART_CURRENCY => 'EUR'); $condition1->setValidatorsFromForm($operators, $values); $conditions = new ConditionCollection(); $conditions[] = $condition1; $conditionFactory = new ConditionFactory($stubContainer); $expected = false; $actual = $conditionFactory->getInputsFromServiceId('thelia.condition.unknown'); $this->assertEquals($expected, $actual); }