本文整理汇总了PHP中Phake::verify方法的典型用法代码示例。如果您正苦于以下问题:PHP Phake::verify方法的具体用法?PHP Phake::verify怎么用?PHP Phake::verify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phake
的用法示例。
在下文中一共展示了Phake::verify方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_launchkey_sso_session_redirects_to_logout_url_and_exits
public function test_launchkey_sso_session_redirects_to_logout_url_and_exits()
{
$this->user->launchkey_sso_session = "Not Null";
$this->client->logout();
Phake::inOrder(Phake::verify($this->facade)->wp_redirect(static::LOGOUT_URL), Phake::verify($this->facade)->_exit(Phake::anyParameters()));
Phake::verifyNoFurtherInteraction($this->facade);
}
示例2: testFindInTrans
public function testFindInTrans()
{
$this->target->begin();
$this->target->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
\Phake::verify($this->write)->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
\Phake::verify($this->read, \Phake::never())->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
}
示例3: testRunAsWorker
public function testRunAsWorker()
{
$receiver = \Phake::mock('ZMQSocket');
$sender = \Phake::mock('ZMQSocket');
$controller = \Phake::mock('ZMQSocket');
$poller = \Phake::mock('ZMQPoll');
$worker = \Phake::partialMock('\\Brook\\Worker');
$task = \Phake::mock('\\Brook\\TaskInterface');
// signal we are a child
\Phake::when($worker)->fork()->thenReturn(0);
\Phake::when($worker)->poll()->thenReturn(\Brook\Worker::READ_READY)->thenReturn(\Brook\Worker::SHUTDOWN);
$message = "one message";
\Phake::when($task)->setup()->thenReturn(null);
\Phake::when($task)->tearDown()->thenReturn(null);
\Phake::when($task)->work($message)->thenReturn($message);
\Phake::when($receiver)->recv()->thenReturn($message);
\Phake::when($sender)->send($message)->thenReturn(true);
// verify
$worker->setReceiver($receiver);
$worker->setController($controller);
$worker->setSender($sender);
$worker->setPoller($poller);
$this->assertEquals(1, $worker->run($task));
\Phake::verify($worker)->fork();
\Phake::verify($sender)->send($message);
\Phake::verify($worker)->forward($message);
\Phake::verify($task)->setup();
\Phake::verify($task)->tearDown();
\Phake::verify($task)->work($message);
}
示例4: testCorrelationDataIsAttached
public function testCorrelationDataIsAttached()
{
CorrelationDataHolder::setCorrelationData(array('correlationId' => 'test'));
$this->testSubject->send(new HelloCommand('Hi !!!'));
\Phake::verify($this->mockCommandBus)->dispatch(\Phake::capture($command), null);
$this->assertEquals(array('correlationId' => 'test'), $command->getMetaData()->all());
}
示例5: test_does_not_update_option_when_check_option_returns_errors
public function test_does_not_update_option_when_check_option_returns_errors()
{
$_POST['nonce'] = 'not empty';
Phake::when($this->admin)->check_option(Phake::anyParameters())->thenReturn(array(array(), array('error')));
$this->wizard->wizard_submit_ajax();
Phake::verify($this->facade, Phake::never())->update_option(Phake::anyParameters());
}
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:7,代码来源:class-launchkey-wp-configuration-wizard-submit-ajax-callback-test.php
示例6: parseNormal
/**
* @test
*/
public function parseNormal()
{
\Phake::when($this->commentsParser)->parse(\Phake::anyParameters())->thenReturn(null);
$stmts = (include __DIR__ . '/../fixtures/1/Model/Product.php.property_base.cache');
$this->parser->parse($stmts, $this->property, $this->class);
\Phake::verify($this->commentsParser)->parse(\Phake::anyParameters());
}
示例7: parseNormal
/**
* @test
*/
public function parseNormal()
{
\Phake::when($this->parser)->parse(\Phake::anyParameters())->thenReturn(null);
$path = __DIR__ . '/../fixtures/1';
$this->projectParser->parse($path);
\Phake::verify($this->parser, \Phake::times(3))->parse(\Phake::anyParameters());
}
示例8: testBuild
public function testBuild()
{
$containerBuilder = \Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
$bundle = new ModeraRoutingBundle();
$bundle->build($containerBuilder);
\Phake::verify($containerBuilder, \Phake::atLeast(2))->addCompilerPass($this->isInstanceOf('Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface'));
}
示例9: test_launchkey_logout_expires_cookies
/**
* @param $cookie_name
*
* @dataProvider cookie_name_provider
*/
public function test_launchkey_logout_expires_cookies($cookie_name)
{
$_COOKIE['launchkey_access_token'] = 'access token';
$this->client->launchkey_logout();
Phake::verify($this->facade)->current_time('timestamp', true);
Phake::verify($this->facade)->setcookie($cookie_name, '1', $this->current_time - 60, COOKIEPATH, COOKIE_DOMAIN);
}
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:12,代码来源:class-launchkey-wp-oauth-client-launchkey-logout-test.php
示例10: testWork
public function testWork()
{
\Phake::when($this->scraper)->scrape(\Phake::anyParameters())->thenReturn(array(new Entity(), new Entity()));
$result = $this->target->work(null);
\Phake::verify($this->scraper)->scrape($this->definition);
$this->assertCount(2, $result);
}
示例11: testBuild
public function testBuild()
{
$builder = \Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
$bundle = new ModeraMJRSecurityIntegrationBundle();
$bundle->build($builder);
\Phake::verify($builder, \Phake::times(1))->addCompilerPass($this->isInstanceOf('Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface'));
}
示例12: testFreeze
public function testFreeze()
{
$client = Phake::mock('Phake_Client_IClient');
$this->freezer->freeze($this->mockInfo, $client);
Phake::verify($client)->processObjectFreeze();
Phake::verify($this->mockInfo)->freezeObject();
}
示例13: testConfigureCustomAggregateFactory
public function testConfigureCustomAggregateFactory()
{
$this->fixture->registerAggregateFactory($this->mockAggregateFactory);
$this->fixture->registerAnnotatedCommandHandler(new MyCommandHandler($this->fixture->getRepository(), $this->fixture->getEventBus()));
$this->fixture->given([new MyEvent("id1", 1)])->when(new TestCommand("id1"));
\Phake::verify($this->mockAggregateFactory, \Phake::atLeast(1))->createAggregate(\Phake::equalTo("id1"), \Phake::anyParameters());
}
示例14: testToString
public function testToString()
{
Phake::when($this->adapted)->__toString->thenReturn('test string');
$result = $this->matcher->__toString();
Phake::verify($this->adapted)->__toString();
$this->assertEquals('test string', $result);
}
示例15: testMagicCallIsRecorded
public function testMagicCallIsRecorded()
{
$mock = $this->getMock('Phake_IMock');
$ref = array('foo', array());
$this->handler->invoke($mock, '__call', array('foo', array()), $ref);
Phake::verify($this->callRecorder)->recordCall(new Phake_CallRecorder_Call($mock, 'foo', array(), $this->mockReader));
}