示例#1
0
 public function testWsdlUrl()
 {
     $url = 'http://test.local/?wsdl=1';
     $cache = '/tmp/cached.wsdl';
     $this->entity->setWsdlUrl($url);
     $this->assertEquals($url, $this->entity->getSettingsBag()->get('wsdl_url'));
     $this->entity->setWsdlCachePath($cache);
     $this->assertEquals($cache, $this->entity->getSettingsBag()->get('wsdl_url'));
 }
示例#2
0
 public function testSettingsBag()
 {
     $data = array('api_user' => 'test_user', 'api_key' => 'test_key', 'wsdl_url' => 'http://test.url/', 'sync_range' => new \DateInterval('P1D'), 'wsi_mode' => true, 'website_id' => 1, 'start_sync_date' => new \DateTime('now'));
     $this->entity->setApiUser($data['api_user'])->setApiKey($data['api_key'])->setWsdlUrl($data['wsdl_url'])->setSyncRange($data['sync_range'])->setIsWsiMode($data['wsi_mode'])->setWebsiteId($data['website_id'])->setSyncStartDate($data['start_sync_date']);
     $settingsBag = $this->entity->getSettingsBag();
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $settingsBag);
     $this->assertSame($settingsBag, $this->entity->getSettingsBag());
     $this->assertEquals($data, $settingsBag->all());
 }