-
-
Save muhamed-didovic/f222a6b68bc11af5945e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| $saveDir = './tests/acceptance/tmp'; | |
| $stubDir = './tests/acceptance/stubs'; | |
| $commandToGenerate = 'FooCommand'; | |
| $I = new AcceptanceTester($scenario); | |
| $I->wantTo('generate a command and handler class'); | |
| // Is there a better way to call the Artisan command? Without having to expect the framework and do ../../../? | |
| $I->runShellCommand("php ../../../artisan commander:generate $commandToGenerate --properties='bar, baz' --base='$saveDir'"); | |
| $I->seeInShellOutput('All done!'); | |
| // My Command stub should match the generated class. | |
| $I->openFile("{$saveDir}/{$commandToGenerate}.php"); | |
| $I->seeFileContentsEqual(file_get_contents("{$stubDir}/{$commandToGenerate}.stub")); | |
| // And my CommandHandler stub should match its generated counterpart, as well. | |
| $I->openFile("{$saveDir}/{$commandToGenerate}Handler.php"); | |
| $I->seeFileContentsEqual(file_get_contents("{$stubDir}/{$commandToGenerate}Handler.stub")); | |
| $I->cleanDir($saveDir); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment