|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * @var Codeception\Scenario $scenario |
| 5 | + */ |
| 6 | + |
| 7 | +$I = new ConsoleTester($scenario); |
| 8 | + |
| 9 | +$I->wantToTest('Generating models'); |
| 10 | +$I->amInPath(dirname(app_path())); |
| 11 | +mkdir(tests_path('_data/console/app/models/model_test'), 0777, true); |
| 12 | + |
| 13 | +$I->runShellCommand('phalcon model --config=app/mysql/config.php --name=testModel --output=app/models/model_test'); |
| 14 | +$I->runShellCommand('phalcon model --config=app/mysql/config.php --name=test-model2 --output=app/models/model_test'); |
| 15 | +$I->runShellCommand('phalcon model --config=app/mysql/config.php --name=test_model3 --output=app/models/model_test'); |
| 16 | +$I->runShellCommand('phalcon model --config=app/mysql/config.php --name=Testmodel4 --output=app/models/model_test'); |
| 17 | + |
| 18 | +$I->seeFileFound(app_path('models/model_test/TestModel.php')); |
| 19 | +$I->seeFileFound(app_path('models/model_test/TestModel2.php')); |
| 20 | +$I->seeFileFound(app_path('models/model_test/TestModel3.php')); |
| 21 | +$I->seeFileFound(app_path('models/model_test/Testmodel4.php')); |
| 22 | + |
| 23 | +$file1 = file_get_contents(app_path('models/files/TestModel.php')); |
| 24 | +$file2 = file_get_contents(app_path('models/files/TestModel2.php')); |
| 25 | +$file3 = file_get_contents(app_path('models/files/TestModel3.php')); |
| 26 | +$file4 = file_get_contents(app_path('models/files/Testmodel4.php')); |
| 27 | + |
| 28 | +$I->openFile(app_path('models/model_test/TestModel.php')); |
| 29 | +$I->seeFileContentsEqual($file1); |
| 30 | + |
| 31 | +$I->openFile(app_path('models/model_test/TestModel2.php')); |
| 32 | +$I->seeFileContentsEqual($file2); |
| 33 | + |
| 34 | +$I->openFile(app_path('models/model_test/TestModel3.php')); |
| 35 | +$I->seeFileContentsEqual($file3); |
| 36 | + |
| 37 | +$I->openFile(app_path('models/model_test/Testmodel4.php')); |
| 38 | +$I->seeFileContentsEqual($file4); |
0 commit comments