FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phalcon-devtools/tests/console/GenerateSingleModelCept.php at master · MESSDEV/phalcon-devtools · GitHub
MESSDEV
/
phalcon-devtools
Public
forked from
phalcon/phalcon-devtools
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phalcon-devtools
/
tests
/
console
/
GenerateSingleModelCept.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
70 lines (52 loc) · 2.11 KB
Breadcrumbs
phalcon-devtools
/
tests
/
console
/
GenerateSingleModelCept.php
Copy path
File metadata and controls
70 lines (52 loc) · 2.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* This file is part of the Phalcon Developer Tools.
*
* (c) Phalcon Team <team@phalcon.io>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare
(strict_types=
1
);
namespace
Phalcon
\
DevTools
\
Tests
\
Console
;
use
Codeception
\
Scenario
;
use
ConsoleTester
;
/**
* @var Scenario $scenario
*/
$
I
=
new
ConsoleTester
(
$
scenario
);
$
I
->
wantToTest
(
'
Generating models
'
);
$
I
->
amInPath
(
dirname
(
app_path
()));
$
modelsTestDir
=
app_path
(
'
models/model_test
'
);
if
(!
is_dir
(
$
modelsTestDir
)) {
mkdir
(
$
modelsTestDir
,
0777
,
true
);
}
$
file1
=
app_path
(
'
models/model_test/TestModel.php
'
);
$
file2
=
app_path
(
'
models/model_test/TestModel2.php
'
);
$
file3
=
app_path
(
'
models/model_test/TestModel3.php
'
);
$
file4
=
app_path
(
'
models/model_test/Testmodel4.php
'
);
$
I
->
dontSeeFileFound
(
$
file1
);
$
I
->
dontSeeFileFound
(
$
file2
);
$
I
->
dontSeeFileFound
(
$
file3
);
$
I
->
dontSeeFileFound
(
$
file4
);
$
I
->
runShellCommand
(
'
phalcon model --config=app/mysql/config.php --name=testModel --output=app/models/model_test --annotate
'
);
$
I
->
runShellCommand
(
'
phalcon model --config=app/mysql/config.php --name=test-model2 --output=app/models/model_test --annotate
'
);
$
I
->
runShellCommand
(
'
phalcon model --config=app/mysql/config.php --name=test_model3 --output=app/models/model_test --annotate
'
);
$
I
->
runShellCommand
(
'
phalcon model --config=app/mysql/config.php --name=Testmodel4 --output=app/models/model_test --annotate
'
);
$
I
->
seeFileFound
(
$
file1
);
$
I
->
seeFileFound
(
$
file2
);
$
I
->
seeFileFound
(
$
file3
);
$
I
->
seeFileFound
(
$
file4
);
$
content1
=
file_get_contents
(
$
file1
);
$
content2
=
file_get_contents
(
$
file2
);
$
content3
=
file_get_contents
(
$
file3
);
$
content4
=
file_get_contents
(
$
file4
);
$
I
->
openFile
(
app_path
(
'
models/model_test/TestModel.php
'
));
$
I
->
seeFileContentsEqual
(
$
content1
);
$
I
->
openFile
(
app_path
(
'
models/model_test/TestModel2.php
'
));
$
I
->
seeFileContentsEqual
(
$
content2
);
$
I
->
openFile
(
app_path
(
'
models/model_test/TestModel3.php
'
));
$
I
->
seeFileContentsEqual
(
$
content3
);
$
I
->
openFile
(
app_path
(
'
models/model_test/Testmodel4.php
'
));
$
I
->
seeFileContentsEqual
(
$
content4
);
$
I
->
deleteDir
(
$
modelsTestDir
);
Back
|
FazBrowse Home
|
New Git URL