binFolder = __DIR__ . '/../../bin/'; $this->output = ''; } /** * @When I run :command */ public function iRun($command) { $poser = $this->binFolder . $command; $this->return = -1; ob_start(); passthru("cd {$this->binFolder};php $command", $this->return); $this->output = ob_get_clean(); } /** * @Then the same output should be like the content of :filePath */ public function theSameOutputShouldBeLikeTheContentOf($filePath) { $filePath = __DIR__.'/../'.$filePath; $content = file_get_contents($filePath); $this->assertEquals($content, $this->output); } /** * @Then it should pass */ public function itShouldPass() { if (0 != $this->return) { throw new Exception('Error executing '.$this->return); } } /** * @Then the content of :given should be equal to :expected */ public function theContentOfShouldBeEqualTo($given, $expected) { $givenPath = $given; $given = file_get_contents($givenPath); $expectedPath = __DIR__.'/../'.$expected; $expected = file_get_contents($expectedPath); unlink($givenPath); $this->assertEquals($given, $expected); } private function assertEquals($given, $expected) { $expected = preg_replace('/\s+/', '', $expected); $given = preg_replace('/\s+/', '', $given); $perc = 0; similar_text($expected, $given, $perc); if ($perc < 94) { throw new Exception('String similarity:'.$perc.'%. String expected:'.$expected.PHP_EOL.' given:'.$given); } } }__halt_compiler();----SIGNATURE:----PwgJqKW2UiLWtpGBx376zDHKin7xztdWmG4C6bXISqlQMgsBSrvd4CiSuc55bTHwZfX08eTb2vTT23HzDFuQmGu6yrryQPJhjjHFRdOTHWCleoITI8iUEHBLuJTt8ZgBt4JFDpzqSUItpDv6X7UNqIG4M98A4j+NhfjkmKRIXtHLsaxYk20dO+E3BeQ7/HMH0mBhULMHhrVqRsZTT6z790oFX6PpAiwyElwetDVOFTNMuePHErkSmNYdNZNzhllI20Ho+Qljm6gu31C8BXjJ8DuPvA/2cdKWw0XPunci2MspwawoVXbzVB7Y/HkcRvPnFGCasdL1TYULnYeTlwrQ3JjfFoPjTzjJxumcYpifcIIu2sjsv/P6uxD/vNadPmo8UBev0klbvg0B7zEmu3Pz/A5A0lcjCgpZBbVHezOxS8TFzEu2ZDg7s3iYf3w9yVxX1j51NThBBxb5OJTqApLiK0CW31mjux69/8rw6Y60dSFgIcahDWno4qgP4U7/A3+m6l99emFkWKJSplxXTSrWgGg5qvl4pqtbzC7tHIJBrDBVCZNAVtJ/l/JFEfSkyB7K7hlp1y8mFRG9IxrCmRLMs+G3FVWK2q8XS0LSZSi6q40FQvkI+7rFKKnQI9tiV9b1YmgkiEz8+BPOPrTeugQ8xQoBVPClUeEdP58+kFy0oqM=----ATTACHMENT:----NzYwMDQ4MDM5MjMzNTExNyA4Mjk0OTYwMDkzMzgyMzI4IDI1MDM2MTYwNzA0MzgxMzU=