return [ [ [ ... ], //data false, //expectedIsOk false //expectedIsWarning ], [ [ ... ], //data false, //expectedIsOk true //expectedIsWarning ], Not ok status when any delayed or failed report exists. Not ok with warning status when only delayed reports exist.
->will($this->returnValue('')); $paramsMock->expects($this->at(1)) ->method('get') ->with($this->equalTo('module')) ->will($this->returnValue('')); $paramsMock->expects($this->at(2)) ->method('get') ->with($this->equalTo('lang')) ->will($this->returnValue('')); } Call order Is the call order relevant? How is it connected to the result? Are empty strings important?
new MoneyConverter(); $convertedMoney = $converter->convert( new Money(10.50, new Currency('PLN')), new Currency('PLN'), MoneyConverter::ROUND_UP ); $this->assertEquals(new Money(10.50, new Currency('PLN')), $convertedMoney); } Currency Money Converter
= $this->getMockForAbstractClass(ExchangeServiceInterface::class); $exchange->method('getRatio')->willReturn(4.0); $converter = new MoneyConverter($exchange); $convertedMoney = $converter->convert( new Money(Decimal::fromFloat(10.10, 2), new Currency('USD')), new Currency('PLN'), MoneyConverter::ROUND_UP ); $this->assertEquals( new Money(Decimal::fromFloat(40.40, 2), new Currency('PLN')), $convertedMoney ); }
your company? • We would work on your code, not on our examples. • Focus on what matters to you. • Long-term support available. Personalized workshops fb.me/QualitySheriffs