本文整理汇总了PHP中Prophecy\Argument::Type方法的典型用法代码示例。如果您正苦于以下问题:PHP Argument::Type方法的具体用法?PHP Argument::Type怎么用?PHP Argument::Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Argument
的用法示例。
在下文中一共展示了Argument::Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InsertProperties
function it_inserts_properties(File $file, Property $property, InsertPropertyHandler $insertPropertyHandler)
{
$properties = [$property->getWrappedObject()];
$insertProperties = new InsertProperties($file->getWrappedObject(), $properties);
$insertProperty = Argument::Type(InsertProperty::class);
$insertPropertyHandler->handle($insertProperty)->shouldBeCalled();
$this->handle($insertProperties);
}
示例2: it_should_not_create_pdf_document_already_created
public function it_should_not_create_pdf_document_already_created(PdfDocument $doc)
{
$this->intent->getPaymentMethod()->willReturn(SepaOfflinePaymentMethod::ID);
$this->event->getDocument()->willReturn($doc);
$this->event->setDocument(Argument::Type('ZendPdf\\PdfDocument'))->shouldNotBeCalled();
$this->event->stopPropagation()->shouldNotBeCalled();
$this->generate($this->event);
}
示例3: InsertUseStatements
function it_does_not_insert_the_same_use_statement_twice(Editor $editor, File $file, FullyQualifiedName $fullyQualifiedName, InsertUseStatementHandler $insertUseStatementHandler)
{
$fullyQualifiedNames = [$fullyQualifiedName->getWrappedObject()];
$insertUseStatements = new InsertUseStatements($file->getWrappedObject(), $fullyQualifiedNames);
$fullyQualifiedName->getFullyQualifiedName()->willReturn('Vendor\\Project\\MyDependency');
$editor->hasBelow($file, '/^use Vendor\\\\Project\\\\MyDependency;$/', 0)->willReturn(true);
$insertUseStatement = Argument::Type(InsertUseStatement::class);
$insertUseStatementHandler->handle($insertUseStatement)->shouldNotBeCalled();
$this->handle($insertUseStatements);
}
示例4: testSendException
public function testSendException()
{
if (!class_exists('\\HipChat\\HipChat')) {
$this->markTestSkipped('The HipChat bundle is not installed.');
}
$hipchatMock = $this->prophesize('\\HipChat\\HipChat');
$hipchatMock->message_room(Argument::Type('string'), Argument::Type('string'), Argument::Type('string'), Argument::Type('bool'), Argument::Type('string'))->willThrow(new \HipChat\HipChat_Exception('400', 'Curl Error', 'http://api.hipchat.com/room'))->shouldBeCalled();
$hipchatNotifier = new HipchatNotifier($hipchatMock->reveal(), new NullLogger(), 'room', 'Hogosha Bot');
$this->assertFalse($hipchatNotifier->send('my message', array('color' => 'yellow')));
}
示例5: foreach
function it_gets_available_updates($client)
{
$fakeResponse = '{"_items":{"core":[{"version":"0.2.1","changelog":["commit1"]},{"version":"0.2.0"}]}}';
$client->call(Argument::Any(), Argument::Type('array'))->willReturn($fakeResponse);
$result = $this->getAvailableUpdates();
$result->shouldHaveCount(1);
$result->shouldBeArray();
foreach ($result['core'] as $package) {
$package->shouldHaveType('SWP\\UpdaterBundle\\Model\\UpdatePackage');
}
}