本文整理匯總了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');
}
}