@@ -22,7 +22,6 @@ public function testCommandOutput()
2222 ]);
2323
2424 $ command = m::mock ('\Themsaid\Langman\Commands\MissingCommand[ask] ' , [$ manager ]);
25- $ command ->shouldReceive ('getDefaultValueFor ' )->times (7 )->with (m::any ())->andReturn (null );
2625 $ command ->shouldReceive ('ask ' )->once ()->with ('/user\.age:nl/ ' , null )->andReturn ('fill_age ' );
2726 $ command ->shouldReceive ('ask ' )->once ()->with ('/product\.name:en/ ' , null )->andReturn ('fill_name ' );
2827 $ command ->shouldReceive ('ask ' )->once ()->with ('/product\.color:nl/ ' , null )->andReturn ('fill_color ' );
@@ -51,7 +50,10 @@ public function testCommandOutput()
5150
5251 public function testAllowSeeTranslationInDefaultLanguage ()
5352 {
53+ $ manager = $ this ->app [Manager::class];
54+
5455 $ this ->app ['config ' ]->set ('app.locale ' , 'en ' );
56+
5557 $ this ->createTempFiles ([
5658 'en ' => [
5759 'user ' => "<?php \n return ['name' => 'Name', 'age' => 'Age']; " ,
@@ -60,18 +62,21 @@ public function testAllowSeeTranslationInDefaultLanguage()
6062 'user ' => "<?php \n return ['name' => 'Naam']; " ,
6163 ],
6264 ]);
63- $ manager = $ this -> app [Manager::class];
65+
6466 $ command = m::mock ('\Themsaid\Langman\Commands\MissingCommand[ask] ' , [$ manager ]);
65- $ command ->shouldReceive ('getDefaultValueFor ' )->once ()->with ('/user\.age/ ' )->andReturn ('en:Age ' );
6667 $ command ->shouldReceive ('ask ' )->once ()->with ('/<fg=yellow>user\.age:nl<\/> translation/ ' , '/en:Age/ ' );
68+
6769 $ this ->app ['artisan ' ]->add ($ command );
6870
6971 $ this ->artisan ('langman:missing ' , ['--default ' => true ]);
7072 }
7173
72- public function testThrowDefaultMessageWhenLanguageFileIsNotFound ()
74+ public function testShowsNoDefaultWhenDefaultLanguageFileIsNotFound ()
7375 {
76+ $ manager = $ this ->app [Manager::class];
77+
7478 $ this ->app ['config ' ]->set ('app.locale ' , 'es ' );
79+
7580 $ this ->createTempFiles ([
7681 'en ' => [
7782 'user ' => "<?php \n return ['name' => 'Name', 'age' => 'Age']; " ,
@@ -80,10 +85,10 @@ public function testThrowDefaultMessageWhenLanguageFileIsNotFound()
8085 'user ' => "<?php \n return ['name' => 'Naam']; " ,
8186 ],
8287 ]);
83- $ manager = $ this -> app [Manager::class];
88+
8489 $ command = m::mock ('\Themsaid\Langman\Commands\MissingCommand[ask] ' , [$ manager ]);
85- $ command ->shouldReceive ('getDefaultValueFor ' )->once ()->with ('/user\.age/ ' )-> andReturn ( " Sorry. File Language not exists for default locale. " );
86- $ command -> shouldReceive ( ' ask ' )-> once ()-> with ( ' /<fg=yellow>user\.age:nl<\/> translation/ ' , ' /Sorry\. File Language not exists for default locale\./ ' );
90+ $ command ->shouldReceive ('ask ' )->once ()->with ('/<fg=yellow> user\.age:nl<\/> translation/ ' , null );
91+
8792 $ this ->app ['artisan ' ]->add ($ command );
8893
8994 $ this ->artisan ('langman:missing ' , ['--default ' => true ]);
0 commit comments