This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional Unit Test for ModuleOptions Class
- Loading branch information
zf2timo
committed
May 23, 2015
1 parent
7904f2f
commit 8897350
Showing
1 changed file
with
59 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace tteMaintenanceTest\Options; | ||
|
||
use tteMaintenance\Options\ModuleOptions; | ||
|
||
class ModuleOptionsTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var ModuleOptions | ||
*/ | ||
protected $options; | ||
|
||
public function setUp() | ||
{ | ||
$this->options = new ModuleOptions(); | ||
} | ||
|
||
/** | ||
* @covers tteMaintenance\Options\ModuleOptions::setMaintenanceProvider | ||
* @covers tteMaintenance\Options\ModuleOptions::getMaintenanceProvider | ||
*/ | ||
public function testSetMaintenanceProvider() | ||
{ | ||
$this->options->setMaintenanceProvider('tteMaintenance\Provider\TimeSpan'); | ||
$this->assertSame('tteMaintenance\Provider\TimeSpan', $this->options->getMaintenanceProvider()); | ||
} | ||
|
||
/** | ||
* @covers tteMaintenance\Options\ModuleOptions::setManualMaintenance | ||
* @covers tteMaintenance\Options\ModuleOptions::getManualMaintenance | ||
*/ | ||
public function testManualMaintenance() | ||
{ | ||
$this->options->setManualMaintenance(true); | ||
$this->assertTrue($this->options->getManualMaintenance()); | ||
} | ||
|
||
/** | ||
* @covers tteMaintenance\Options\ModuleOptions::setRedirect | ||
* @covers tteMaintenance\Options\ModuleOptions::getRedirect | ||
*/ | ||
public function testRedirectOption() | ||
{ | ||
$this->options->setRedirect('/'); | ||
$this->assertSame($this->options->getRedirect(), '/'); | ||
} | ||
|
||
/** | ||
* tteMaintenance\Options\ModuleOptions::setRedirectType | ||
* tteMaintenance\Options\ModuleOptions::getRedirectType | ||
*/ | ||
public function testRedirectTypeOptions() | ||
{ | ||
$this->options->setRedirectType('route'); | ||
$this->assertSame($this->options->getRedirectType(), 'route'); | ||
} | ||
} |