Skip to content

Commit

Permalink
PHPUnit assertEquals fix
Browse files Browse the repository at this point in the history
Fixes `assertEquals()` parameter order.
  • Loading branch information
amostajo committed Jan 18, 2020
1 parent afcc8f6 commit 988678b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions tests/cases/CreateAssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.1.5
* @version 1.1.6
*/
class CreateAssetTest extends WpmvcAyucoTestCase
{
Expand All @@ -30,7 +30,7 @@ public function testJs()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create js:yolo');
// Assert
$this->assertEquals($execution, 'js asset created!');
$this->assertEquals('js asset created!', $execution);
$this->assertFileExists($filename);
}
/**
Expand All @@ -43,7 +43,7 @@ public function testJsJquery()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create js:jquery.yolo jquery');
// Assert
$this->assertEquals($execution, 'js asset created!');
$this->assertEquals('js asset created!', $execution);
$this->assertFileExists($filename);
$this->assertPregMatchContents('/jQuery/', $filename);
}
Expand All @@ -57,7 +57,7 @@ public function testCss()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create css:yolo');
// Assert
$this->assertEquals($execution, 'css asset created!');
$this->assertEquals('css asset created!', $execution);
$this->assertFileExists($filename);
}
/**
Expand All @@ -70,7 +70,7 @@ public function testSassMaster()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create sass:styles');
// Assert
$this->assertEquals($execution, 'scss asset created!');
$this->assertEquals('scss asset created!', $execution);
$this->assertFileExists($filename);
$this->assertPregMatchContents('/master/', $filename);
}
Expand All @@ -85,7 +85,7 @@ public function testSassPart()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create sass:theme main');
// Assert
$this->assertEquals($execution, 'scss asset created!');
$this->assertEquals('scss asset created!', $execution);
$this->assertFileExists($masterfile);
$this->assertFileExists($partfile);
$this->assertPregMatchContents('/master/', $masterfile);
Expand All @@ -105,7 +105,7 @@ public function testSassMasterAndParts()
exec('php '.WPMVC_AYUCO.' create sass:header theme');
$execution = exec('php '.WPMVC_AYUCO.' create sass:footer theme');
// Assert
$this->assertEquals($execution, 'scss asset created!');
$this->assertEquals('scss asset created!', $execution);
$this->assertFileExists($masterfile);
$this->assertFileExists($part1file);
$this->assertFileExists($part2file);
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/CreateControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.1.4
* @version 1.1.6
*/
class CreateControllerTest extends WpmvcAyucoTestCase
{
Expand All @@ -24,7 +24,7 @@ public function testCreateCommand()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create controller:CreateController@yolo');
// Assert
$this->assertEquals($execution, 'Controller created!');
$this->assertEquals('Controller created!', $execution);
$this->assertFileExists($filename);
$this->assertFileFunctionExists('yolo', $filename);
}
Expand All @@ -38,7 +38,7 @@ public function testAddHookCommand()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' add action:init ActionController@init');
// Assert
$this->assertEquals($execution, 'Controller created!');
$this->assertEquals('Controller created!', $execution);
$this->assertFileExists($filename);
$this->assertFileFunctionExists('init', $filename);
}
Expand All @@ -52,7 +52,7 @@ public function testCreateCommandMultipleMethods()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create controller:CreateController@yolo@init@twice');
// Assert
$this->assertEquals($execution, 'Controller created!');
$this->assertEquals('Controller created!', $execution);
$this->assertFileExists($filename);
$this->assertFileFunctionExists('yolo', $filename);
$this->assertFileFunctionExists('init', $filename);
Expand Down
12 changes: 6 additions & 6 deletions tests/cases/CreateModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.1.5
* @version 1.1.6
*/
class CreateModelTest extends WpmvcAyucoTestCase
{
Expand All @@ -24,7 +24,7 @@ public function testOptionModel()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create optionmodel:App app');
// Assert
$this->assertEquals($execution, 'Model created!');
$this->assertEquals('Model created!', $execution);
$this->assertFileExists($filename);
$this->assertFileVariableExists('id', $filename, 'app');
}
Expand All @@ -38,7 +38,7 @@ public function testUserModel()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create usermodel:User');
// Assert
$this->assertEquals($execution, 'Model created!');
$this->assertEquals('Model created!', $execution);
$this->assertFileExists($filename);
}
/**
Expand All @@ -51,7 +51,7 @@ public function testCategoryModel()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create categorymodel:AppCategoryModel');
// Assert
$this->assertEquals($execution, 'Model created!');
$this->assertEquals('Model created!', $execution);
$this->assertFileExists($filename);
$this->assertPregMatchContents('/TermModel/', $filename);
}
Expand All @@ -65,7 +65,7 @@ public function testTermModel()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create termmodel:AppTermModel');
// Assert
$this->assertEquals($execution, 'Model created!');
$this->assertEquals('Model created!', $execution);
$this->assertFileExists($filename);
}
/**
Expand All @@ -78,7 +78,7 @@ public function testTermModelWithTax()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create termmodel:AppTermModel custom_tax');
// Assert
$this->assertEquals($execution, 'Model created!');
$this->assertEquals('Model created!', $execution);
$this->assertFileExists($filename);
$this->assertFileVariableExists('model_taxonomy', $filename, 'custom_tax');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/CreateViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.1.4
* @version 1.1.6
*/
class CreateViewTest extends WpmvcAyucoTestCase
{
Expand All @@ -24,7 +24,7 @@ public function test()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' create view:test.test');
// Assert
$this->assertEquals($execution, 'View created!');
$this->assertEquals('View created!', $execution);
$this->assertFileExists($filename);
}
}
6 changes: 3 additions & 3 deletions tests/cases/RegisterWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.1.4
* @version 1.1.6
*/
class RegisterWidgetTest extends WpmvcAyucoTestCase
{
Expand All @@ -24,7 +24,7 @@ public function test()
// Execure
$execution = exec('php '.WPMVC_AYUCO.' register widget:Test');
// Assert
$this->assertEquals($execution, 'Widget registered!');
$this->assertEquals('Widget registered!', $execution);
$this->assertFileExists($filename);
}
/**
Expand All @@ -36,6 +36,6 @@ public function testPreventDuplicate()
exec('php '.WPMVC_AYUCO.' register widget:Original');
$execution = exec('php '.WPMVC_AYUCO.' register widget:Original');
// Assert
$this->assertEquals($execution, 'Widget exists!');
$this->assertEquals('Widget exists!', $execution);
}
}
8 changes: 4 additions & 4 deletions tests/cases/SetVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.0.4
* @version 1.1.6
*/
class SetVersionTest extends AyucoTestCase
{
Expand All @@ -17,7 +17,7 @@ public function testResultMessage()
{
$execution = exec('php '.WPMVC_AYUCO.' set version:1.5.0');

$this->assertEquals($execution, 'Version updated!');
$this->assertEquals('Version updated!', $execution);
}
/**
* Test if version value has been changed.
Expand All @@ -27,7 +27,7 @@ public function testVersionValue()
$execution = exec('php '.WPMVC_AYUCO.' set version:2.0.0');
$json = json_decode(file_get_contents(FRAMEWORK_PATH.'/environment/package.json'));

$this->assertEquals($json->version, '2.0.0');
$this->assertEquals('2.0.0', $json->version);

// Down test
exec('php '.WPMVC_AYUCO.' set version:1.0.0');
Expand All @@ -44,7 +44,7 @@ public function testThemeVersionValue()
$matches
);

$this->assertEquals($matches[0], 'Version: 1.7.5');
$this->assertEquals('Version: 1.7.5', $matches[0]);

// Down test
exec('php '.WPMVC_AYUCO.' set version:1.0.0');
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/SetupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC\Commands
* @version 1.0.0
* @version 1.1.6
*/
class SetupTest extends AyucoTestCase
{
Expand All @@ -17,6 +17,6 @@ public function test()
{
$execution = exec('php '.WPMVC_AYUCO.' setup');

$this->assertEquals($execution, 'SetupCommand: "setname" command is not registered in ayuco.');
$this->assertEquals('SetupCommand: "setname" command is not registered in ayuco.', $execution);
}
}

0 comments on commit 988678b

Please sign in to comment.