-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from OXIDprojects/c-test
add tests for consistency controller
- Loading branch information
Showing
4 changed files
with
50 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: keywan | ||
* Date: 04.01.19 | ||
* Time: 00:01 | ||
*/ | ||
|
||
namespace OxidCommunity\ModuleInternals\Tests\Integration\Controller; | ||
|
||
use OxidEsales\TestingLibrary\UnitTestCase; | ||
use OxidCommunity\ModuleInternals\Controller\CheckConsistency; | ||
use OxidEsales\Eshop\Core\Utils; | ||
use OxidEsales\Eshop\Core\Registry; | ||
|
||
class CheckConsistencyTest extends UnitTestCase | ||
{ | ||
|
||
public function testRender() | ||
{ | ||
$controller = oxNew(CheckConsistency::class); | ||
$result = $controller->render(); | ||
$this->assertSame('checkconsistency.tpl', $result); | ||
} | ||
|
||
public function testInit() | ||
{ | ||
$controller = oxNew(CheckConsistency::class); | ||
$mockBuilder = $this->getMockBuilder(Utils::class); | ||
$mockBuilder->setMethods(['handlePageNotFoundError']); | ||
$utils = $mockBuilder->getMock(); | ||
$utils->expects($this->once())->method("handlePageNotFoundError"); | ||
Registry::set(Utils::class, $utils); | ||
$controller->init(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters