本文整理汇总了PHP中Prophecy\Prophecy\ObjectProphecy::set方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectProphecy::set方法的具体用法?PHP ObjectProphecy::set怎么用?PHP ObjectProphecy::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setWithoutNamedParameterQuotesIdentifierAndDelegatesToConcreteQueryBuilder
/**
* @test
*/
public function setWithoutNamedParameterQuotesIdentifierAndDelegatesToConcreteQueryBuilder()
{
$this->connection->quoteIdentifier('aField')->shouldBeCalled()->willReturnArgument(0);
$this->concreteQueryBuilder->createNamedParameter(Argument::cetera())->shouldNotBeCalled();
$this->concreteQueryBuilder->set('aField', 'aValue')->shouldBeCalled()->willReturn($this->subject);
$this->subject->set('aField', 'aValue', false);
}
示例2: testSetWorkingCopySetting
public function testSetWorkingCopySetting()
{
$this->configEditor->get('global-settings.sample_name', '')->willReturn('global_value');
$setting_name = 'path-settings[svn://localhost].sample_name';
$this->configEditor->get($setting_name)->willReturn('old_value');
$this->configEditor->set($setting_name, 'new_value')->will(function (array $args, $object) {
$object->get($args[0])->willReturn($args[1]);
});
$this->command->getConfigSettings()->willReturn(array(new StringConfigSetting('sample_name', '', AbstractConfigSetting::SCOPE_WORKING_COPY)));
$this->workingCopyResolver->getWorkingCopyUrl('/path/to/working-copy')->willReturn('svn://localhost');
$this->commandConfig->setSettingValue('sample_name', $this->command->reveal(), '/path/to/working-copy', 'new_value');
$this->assertEquals('new_value', $this->commandConfig->getSettingValue('sample_name', $this->command->reveal(), '/path/to/working-copy'));
}
示例3: testStorage
/**
* @dataProvider storageDataProvider
*/
public function testStorage($user_value, $stored_value)
{
$this->configEditor->set(new ConfigStorageNameToken('name', AbstractConfigSetting::SCOPE_GLOBAL), $stored_value)->shouldBeCalled();
$config_setting = $this->createConfigSetting(AbstractConfigSetting::SCOPE_GLOBAL);
$config_setting->setValue($user_value);
}
示例4: clientLock
protected function clientLock(ObjectProphecy $client)
{
$client->set(Argument::type('string'), Argument::exact(1), Argument::type('array'))->willReturn(true);
$client->expire(Argument::type('string'), Argument::exact(31))->willReturn(true);
$client->del(Argument::type('string'))->willReturn(true);
}
示例5: testSet
/**
* @covers ::set
*
* @dataProvider providerSet
*
* @param string $key
* @param mixed $value
*/
public function testSet($key, $value)
{
$this->decoratedFormState->set($key, $value)->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->set($key, $value));
}