-
Notifications
You must be signed in to change notification settings - Fork 7
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 #8 from sjokki/version-2
Filter namespaces of return types, keep nullable when filtering a namespace
- Loading branch information
Showing
4 changed files
with
48 additions
and
4 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,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the memio/twig-template-engine package. | ||
* | ||
* (c) Loïc Faugeron <faugeron.loic@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace spec\Memio\TwigTemplateEngine\TwigExtension; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
|
||
class TypeSpec extends ObjectBehavior | ||
{ | ||
public function it_can_be_a_non_object() | ||
{ | ||
$this->filterNamespace('int')->shouldBe('int'); | ||
} | ||
|
||
public function it_can_be_a_nullable_non_object() | ||
{ | ||
$this->filterNamespace('?int')->shouldBe('?int'); | ||
} | ||
|
||
public function it_can_be_an_object() | ||
{ | ||
$this->filterNamespace('Vendor\Project\MyClass')->shouldBe('MyClass'); | ||
} | ||
|
||
public function it_can_be_a_nullable_object() | ||
{ | ||
$this->filterNamespace('?Vendor\Project\MyClass')->shouldBe('?MyClass'); | ||
} | ||
} |
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