public function execute($stdin) { $meter = new Meter(); $i = 0; for ($i = 0; $i < strlen($stdin) - 1; $i++) { $route = substr($stdin, $i, 2); $meter->add($route); } return $meter->payoff(); }
/** * @test * @group meter-test1 **/ public function test1() { $meter = new Meter(); $meter->add('AD'); $this->assertEquals($meter->payoff(), 400); $meter->add('DF'); $this->assertEquals($meter->payoff(), 450); $meter->add('FC'); $this->assertEquals($meter->payoff(), 510); }