This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from linusshops/develop
Develop
- Loading branch information
Showing
11 changed files
with
113 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
use LinusShops\Prophet\Commands\Scry; | ||
use Symfony\Component\Console\Application; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
/** | ||
* | ||
* | ||
* @author Sam Schmidt | ||
* @date 2015-05-04 | ||
* @company Linus Shops | ||
*/ | ||
|
||
namespace LinusShops\Prophet; | ||
|
||
use LinusShops\Prophet\Commands\Scry; | ||
use LinusShops\Prophet\Commands\Validate; | ||
use Symfony\Component\Console\Application; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class ProphetCommandTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
private $path = './magento'; | ||
|
||
public function getJson() | ||
{ | ||
return <<<JSON | ||
{ | ||
"modules": [ | ||
{ | ||
"path": "vendor/linusshops/prophet-magento-test-module", | ||
"name": "test-module" | ||
} | ||
] | ||
} | ||
JSON; | ||
} | ||
|
||
public function getJsonPath() | ||
{ | ||
return $this->path.'/prophet.json'; | ||
} | ||
|
||
public function setUp() | ||
{ | ||
if (file_exists($this->getJsonPath())) { | ||
unlink($this->getJsonPath()); | ||
} | ||
|
||
file_put_contents($this->getJsonPath(), $this->getJson()); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
if (file_exists($this->getJsonPath())) { | ||
unlink($this->getJsonPath()); | ||
} | ||
} | ||
|
||
public function testScryFullExecution() | ||
{ | ||
$output = shell_exec("./prophet scry -p ./magento"); | ||
|
||
$this->assertRegExp('/OK \(1 test, 1 assertion\)/', $output); | ||
} | ||
|
||
public function testValidateCommand() | ||
{ | ||
$application = new Application(); | ||
$application->add(new Validate()); | ||
|
||
$command = $application->find('validate'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute(array( | ||
'command' => $command->getName() | ||
), array( | ||
'-p' => './magento' | ||
)); | ||
|
||
//$commandTester->getDisplay(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.