vendor文件夹 缺失文件提交
This commit is contained in:
39
vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php
vendored
Normal file
39
vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Comparator;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use Prophecy\Argument;
|
||||
|
||||
class ClosureComparatorSpec extends ObjectBehavior
|
||||
{
|
||||
function it_is_comparator()
|
||||
{
|
||||
$this->shouldHaveType('SebastianBergmann\Comparator\Comparator');
|
||||
}
|
||||
|
||||
function it_accepts_only_closures()
|
||||
{
|
||||
$this->accepts(123, 321)->shouldReturn(false);
|
||||
$this->accepts('string', 'string')->shouldReturn(false);
|
||||
$this->accepts(false, true)->shouldReturn(false);
|
||||
$this->accepts(true, false)->shouldReturn(false);
|
||||
$this->accepts((object)array(), (object)array())->shouldReturn(false);
|
||||
$this->accepts(function(){}, (object)array())->shouldReturn(false);
|
||||
$this->accepts(function(){}, (object)array())->shouldReturn(false);
|
||||
|
||||
$this->accepts(function(){}, function(){})->shouldReturn(true);
|
||||
}
|
||||
|
||||
function it_asserts_that_all_closures_are_different()
|
||||
{
|
||||
$this->shouldThrow()->duringAssertEquals(function(){}, function(){});
|
||||
}
|
||||
|
||||
function it_asserts_that_all_closures_are_different_even_if_its_the_same_closure()
|
||||
{
|
||||
$closure = function(){};
|
||||
|
||||
$this->shouldThrow()->duringAssertEquals($closure, $closure);
|
||||
}
|
||||
}
|
20
vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php
vendored
Normal file
20
vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Comparator;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use Prophecy\Argument;
|
||||
|
||||
class FactorySpec extends ObjectBehavior
|
||||
{
|
||||
function it_extends_Sebastian_Comparator_Factory()
|
||||
{
|
||||
$this->shouldHaveType('SebastianBergmann\Comparator\Factory');
|
||||
}
|
||||
|
||||
function it_should_have_ClosureComparator_registered()
|
||||
{
|
||||
$comparator = $this->getInstance()->getComparatorFor(function(){}, function(){});
|
||||
$comparator->shouldHaveType('Prophecy\Comparator\ClosureComparator');
|
||||
}
|
||||
}
|
39
vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php
vendored
Normal file
39
vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Comparator;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\Prophet;
|
||||
|
||||
class ProphecyComparatorSpec extends ObjectBehavior
|
||||
{
|
||||
function it_is_a_comparator()
|
||||
{
|
||||
$this->shouldHaveType('SebastianBergmann\Comparator\ObjectComparator');
|
||||
}
|
||||
|
||||
function it_accepts_only_prophecy_objects()
|
||||
{
|
||||
$this->accepts(123, 321)->shouldReturn(false);
|
||||
$this->accepts('string', 'string')->shouldReturn(false);
|
||||
$this->accepts(false, true)->shouldReturn(false);
|
||||
$this->accepts(true, false)->shouldReturn(false);
|
||||
$this->accepts((object)array(), (object)array())->shouldReturn(false);
|
||||
$this->accepts(function(){}, (object)array())->shouldReturn(false);
|
||||
$this->accepts(function(){}, function(){})->shouldReturn(false);
|
||||
|
||||
$prophet = new Prophet();
|
||||
$prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy');
|
||||
|
||||
$this->accepts($prophecy, $prophecy)->shouldReturn(true);
|
||||
}
|
||||
|
||||
function it_asserts_that_an_object_is_equal_to_its_revealed_prophecy()
|
||||
{
|
||||
$prophet = new Prophet();
|
||||
$prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy');
|
||||
|
||||
$this->shouldNotThrow()->duringAssertEquals($prophecy->reveal(), $prophecy);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user