-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#111. Add MethodOptionsTest/ConfigOptionsTest + improve others + file…
…s unlink
- Loading branch information
1 parent
7d75938
commit 0facfc8
Showing
9 changed files
with
442 additions
and
330 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,59 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: arthurkushman | ||
* Date: 03.06.18 | ||
* Time: 14:48 | ||
*/ | ||
|
||
namespace rjapitest\unit\helpers; | ||
|
||
|
||
use rjapi\helpers\MethodOptions; | ||
use rjapi\types\MiddlewareInterface; | ||
use rjapi\types\PhpInterface; | ||
use rjapitest\unit\TestCase; | ||
|
||
/** | ||
* Class MethodOptionsTest | ||
* @package rjapitest\unit\helpers | ||
* | ||
* @property MethodOptions methodOptions | ||
*/ | ||
class MethodOptionsTest extends TestCase | ||
{ | ||
private $methodOptions; | ||
|
||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->methodOptions = new MethodOptions(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_sets_and_gets_options() | ||
{ | ||
$this->methodOptions->setModifier(PhpInterface::PHP_MODIFIER_PRIVATE); | ||
$this->assertEquals(PhpInterface::PHP_MODIFIER_PRIVATE, $this->methodOptions->getModifier()); | ||
|
||
$this->methodOptions->setName('foo'); | ||
$this->assertEquals('foo', $this->methodOptions->getName()); | ||
|
||
$this->methodOptions->setReturnType('bool'); | ||
$this->assertEquals('bool', $this->methodOptions->getReturnType()); | ||
|
||
$this->methodOptions->setIsStatic(true); | ||
$this->assertTrue($this->methodOptions->isStatic()); | ||
|
||
$this->methodOptions->setParams([ | ||
MiddlewareInterface::METHOD_PARAM_REQUEST, | ||
PhpInterface::CLASS_CLOSURE => MiddlewareInterface::METHOD_PARAM_NEXT, | ||
]); | ||
$this->assertArraySubset([ | ||
MiddlewareInterface::METHOD_PARAM_REQUEST, | ||
PhpInterface::CLASS_CLOSURE => MiddlewareInterface::METHOD_PARAM_NEXT, | ||
], $this->methodOptions->getParams()); | ||
} | ||
} |