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:----ycyO6M+3UdQBJv07B73+BZYL7NwTxeZdGLnAeQHppkumLmTxt0DSYhNigom/mNcSuN7ffyrM/oUVox1J6HooSj2wnxJkkGkEKxAhxbxILYBaPDIEsx87yFq82vb2MQS58PQjwhnMVeZL7VkzTNUXRSmi76YGF/uDNIF2tJGD08yUixP0pLAGpbLsIB6EfHmovMRIfDB2AhS25pvhFPEC+FANB7iS6AgSQ67ZCxFX9JdvI8vswXVZrfzmT+wNm0BWd09aQfpIdjuJK2z5wlWmcRIC8b8Fe8DrR3eZHYNkgZdTQGJjjRENWFO5KWbyA7FSuh1gy272JCIbnCzDCj2zGxXvT4WuYNTzR+0CFkM7z5xOnfVimZbrwAEQA6N5r6SIabV/TKtXQ1Gxo5b0GtdbmfTF7LOp7qIYBMroSyep9svnrEPwNpRlia/sz52gU/BoOgJHSxSiq0iYDhtmF0RcWOEXqw1WjPBXrD7HU8q2prSuk3KiS5iAlSGw38sCSjs4lObDYADQuv8FxRzYJVQQTnCezRKt7HGaysNtkFSdiy7p/5TmoDSjejcpNQZT9U/nH5MrlYjRQ4mVxtApNJ4iPuJD4WmCZhcurYmikU1askG7piDNqz6MoC/fTiYoIZwCJfBiO1b7Ci62/BhCflEc50ZkGuRiG/QQjHRpM+hn1FA=----ATTACHMENT:----MjU3NzA2NTMzMjY0MTM2NyA4ODUzOTI4Mjc1OTMwNzU3IDk1MzA0OTM0NDc2MzcwMDk=