@@ -42,36 +42,61 @@ public function setUp(): void
4242 public function testLocalClone ()
4343 {
4444 $ sitename = getenv ('TERMINUS_SITE ' );
45- $ local_sites_folder = realpath (getenv ('TERMINUS_LOCAL_SITES ' )) . DIRECTORY_SEPARATOR .
46- 'pantheon-local-copies ' ;
47- $ willBeCreated = $ local_sites_folder . DIRECTORY_SEPARATOR . $ sitename ;
48- $ this ->terminus ("local:clone {$ sitename }" , null );
49- $ this ->assertTrue (is_dir ($ willBeCreated ));
45+ $ result = $ this ->terminus ("local:clone {$ sitename }" , null );
46+ if (!is_string ($ result )) {
47+ throw new \Exception ("The response from the local clone command didn't return the path. " );
48+ }
49+ $ shouldExist = $ result . DIRECTORY_SEPARATOR . '.git ' ;
50+ $ this ->assertTrue (
51+ is_dir ($ shouldExist ),
52+ "The sites .git directory does not exist: {$ shouldExist }"
53+ );
5054 }
5155
5256 /**
5357 * @test
54- * @covers \Pantheon\Terminus\Commands\Local\CommitAndPushCommand
55- * @covers \Pantheon\Terminus\Commands\Local\GetLiveFilesCommand
5658 * @covers \Pantheon\Terminus\Commands\Local\GetLiveDBCommand
5759 *
5860 * @group local
5961 * @gropu long
6062 */
61- public function testCommitDbFiles ()
63+ public function testCommitDb ()
64+ {
65+ $ sitename = getenv ('TERMINUS_SITE ' );
66+ $ result = $ this ->terminus ("local:getLiveDB {$ sitename }.live " );
67+ $ this ->assertTrue (
68+ is_file ($ result ),
69+ "The db file failed to download. "
70+ );
71+ }
72+
73+ /**
74+ * @test
75+ * @covers \Pantheon\Terminus\Commands\Local\GetLiveFilesCommand
76+ *
77+ * @group local
78+ * @gropu long
79+ */
80+ public function testCommitFiles ()
6281 {
63- $ this ->fail ("To Be Written " );
82+ $ sitename = getenv ('TERMINUS_SITE ' );
83+ $ result = $ this ->terminus ("local:getLiveFiles {$ sitename }.live " );
84+ $ this ->assertTrue (
85+ is_file ($ result ),
86+ 'The site file failed to download. '
87+ );
6488 }
6589
6690 /**
6791 * @after
6892 */
6993 public function tearDown (): void
7094 {
71- $ local_sites_folder = realpath (getenv ('TERMINUS_LOCAL_SITES ' )) . DIRECTORY_SEPARATOR .
72- 'pantheon-local-copies ' ;
73- if (is_dir ($ local_sites_folder )) {
74- exec ("rm -Rf {$ local_sites_folder }" );
95+ $ sitename = getenv ('TERMINUS_SITE ' );
96+ $ local_site_folder = realpath (getenv ('TERMINUS_LOCAL_SITES ' )) . DIRECTORY_SEPARATOR .
97+ 'pantheon-local-copies ' . DIRECTORY_SEPARATOR . $ sitename ;
98+ if (is_dir ($ local_site_folder )) {
99+ exec ("rm -Rf {$ local_site_folder }" );
75100 }
76101 }
77102}
0 commit comments