示例#1
0
文件: Ecwid.php 项目: kingsj/core
 /**
  * testGetInfo 
  * 
  * @return void
  * @see    ____func_see____
  * @since  1.0.17
  */
 public function testGetInfo()
 {
     $model = new \XLite\Model\DataSource();
     $model->setParameterValue('storeid', 1003);
     $model->setType(\XLite\Model\DataSource::TYPE_ECWID);
     $ecwid = $model->detectSource();
     $this->assertTrue($ecwid->isValid());
     $info = $ecwid->getInfo();
     $this->assertEquals('Ecwid Demo Store', $info['storeName']);
 }
示例#2
0
 /**
  * Test Ecwid categories collection iterator
  * 
  * @return void
  * @see    ____func_see____
  * @since  1.0.17
  */
 public function testCategories()
 {
     $model = new \XLite\Model\DataSource();
     $model->setParameterValue('storeid', 1003);
     $model->setType(\XLite\Model\DataSource::TYPE_ECWID);
     $ecwid = $model->detectSource();
     $this->assertTrue($ecwid->isValid());
     $categories = $ecwid->getCategoriesCollection();
     $this->assertNotEmpty($categories->count());
     $this->assertTrue($categories->isValid());
     $firstCat = $categories->current();
     foreach ($this->requiredFields as $f) {
         $this->assertNotEmpty($firstCat[$f]);
     }
 }
示例#3
0
 /**
  * testSetParameterValue 
  * 
  * @return void
  * @see    ____func_see____
  * @since  1.0.17
  */
 public function testSetParameterValue()
 {
     $s = new \XLite\Model\DataSource();
     $s->map($this->entityData);
     foreach ($this->parameters as $param) {
         $s->setParameterValue($param['name'], $param['value']);
     }
     foreach ($this->parameters as $param) {
         $this->assertEquals($param['value'], $s->getParameterValue($param['name']));
     }
     // Redefine existing values
     $parameters = $this->parameters;
     foreach ($parameters as &$param) {
         $param['value'] = uniqid();
         $s->setParameterValue($param['name'], $param['value']);
     }
     unset($param);
     foreach ($parameters as $param) {
         $this->assertEquals($param['value'], $s->getParameterValue($param['name']));
     }
 }