Skip to content

Commit

Permalink
fix tests for L42
Browse files Browse the repository at this point in the history
  • Loading branch information
potsky committed Feb 2, 2016
1 parent 5d62928 commit 22eba98
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
13 changes: 9 additions & 4 deletions tests/fixes/Gh21Tests.php
@@ -1,6 +1,7 @@
<?php

use Potsky\LaravelLocalizationHelpers\Factory\Localization;
use Symfony\Component\Console\Output\BufferedOutput;

class Gh21Tests extends TestCase
{
Expand Down Expand Up @@ -65,14 +66,16 @@ public function testObsoleteSubKeyRemoved()
{
Config::set( Localization::PREFIX_LARAVEL_CONFIG . 'folders' , self::MOCK_DIR_PATH . '/gh21/code' );

$output = new BufferedOutput;

/** @noinspection PhpVoidFunctionResultUsedInspection */
Artisan::call( 'localization:missing' , array(
'--no-interaction' => true ,
'--no-backup' => true ,
'--verbose' => true ,
) );
) , $output );

$this->assertContains( '1 obsolete string' , Artisan::output() );
$this->assertContains( '1 obsolete string' , $output->fetch() );

$this->assertArrayHasKey( 'LLH:obsolete' , require( self::$langFile ) );
}
Expand All @@ -88,13 +91,15 @@ public function testObsoleteAreKept()
// Set content in lang file with obsolete lemma
File::put( self::$langFile , self::$defaultLangWithObsoleteContent );

$output = new BufferedOutput;

/** @noinspection PhpVoidFunctionResultUsedInspection */
Artisan::call( 'localization:missing' , array(
'--no-interaction' => true ,
'--no-backup' => true ,
) );
) , $output );

$this->assertContains( '1 obsolete string' , Artisan::output() );
$this->assertContains( '1 obsolete string' , $output->fetch() );

$lemmas = require( self::$langFile );

Expand Down
13 changes: 9 additions & 4 deletions tests/fixes/Gh22Tests.php
@@ -1,6 +1,7 @@
<?php

use Potsky\LaravelLocalizationHelpers\Factory\Localization;
use Symfony\Component\Console\Output\BufferedOutput;

class Gh22Tests extends TestCase
{
Expand Down Expand Up @@ -45,13 +46,15 @@ public function testObsoleteKeyIsNotRemoved()
{
Config::set( Localization::PREFIX_LARAVEL_CONFIG . 'folders' , self::MOCK_DIR_PATH . '/gh22/phase1' );

$output = new BufferedOutput;

/** @noinspection PhpVoidFunctionResultUsedInspection */
Artisan::call( 'localization:missing' , array(
'--no-interaction' => true ,
'--no-backup' => true ,
) );
) , $output );

$this->assertContains( '1 obsolete string' , Artisan::output() );
$this->assertContains( '1 obsolete string' , $output->fetch() );

$lemmas = require( self::$langFile );

Expand All @@ -67,14 +70,16 @@ public function testObsoleteKeyIsRemovedWhenSettingOption()
{
Config::set( Localization::PREFIX_LARAVEL_CONFIG . 'folders' , self::MOCK_DIR_PATH . '/gh22/phase1' );

$output = new BufferedOutput;

/** @noinspection PhpVoidFunctionResultUsedInspection */
Artisan::call( 'localization:missing' , array(
'--no-interaction' => true ,
'--no-backup' => true ,
'--no-obsolete' => true ,
) );
) , $output );

$this->assertContains( '1 obsolete string' , Artisan::output() );
$this->assertContains( '1 obsolete string' , $output->fetch() );

$lemmas = require( self::$langFile );

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/gh21/lang/en/message.php
@@ -1,6 +1,6 @@
<?php
/*************************************************************************
Generated via "php artisan localization:missing" at 2016/02/02 10:42:49
Generated via "php artisan localization:missing" at 2016/02/02 17:44:41
*************************************************************************/

return array (
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/gh22/lang/en/message.php
@@ -1,6 +1,6 @@
<?php
/*************************************************************************
Generated via "php artisan localization:missing" at 2016/02/02 10:42:52
Generated via "php artisan localization:missing" at 2016/02/02 17:44:41
*************************************************************************/

return array (
Expand Down

0 comments on commit 22eba98

Please sign in to comment.