/**
  * @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);
 }
 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'));
 }
 /**
  * @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);
 }
 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);
 }
 /**
  * @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));
 }