Last active
August 29, 2015 14:13
-
-
Save trq/d50fbe0254496136c82c to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Trq; | |
class Foo | |
{ | |
protected function __construct() | |
{ | |
} | |
public static function create() | |
{ | |
return new static(); | |
} | |
} |
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
<?php | |
namespace spec\Trq; | |
use PhpSpec\ObjectBehavior; | |
use Prophecy\Argument; | |
class FooSpec extends ObjectBehavior | |
{ | |
function it_is_initializable() | |
{ | |
$this->beConstructedThrough('create'); | |
$this->shouldHaveType('Trq\Foo'); | |
} | |
} |
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
Trq\Foo | |
10 ! is initializable | |
exception [exc:ReflectionException("Access to non-public constructor of class Trq\Foo")] has been thrown. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment