コード例 #1
0
 public function testCreateFromJson()
 {
     $factory = $this->getModelFactory();
     $jsonObject = json_decode('{}');
     $autocomplete = Autocomplete::createFromJson($jsonObject, $factory);
     $this->assertEquals(Autocomplete::NOT_REQUESTED, $autocomplete->getCategories());
     $this->assertEquals(Autocomplete::NOT_REQUESTED, $autocomplete->getProducts());
     $this->assertEquals(Autocomplete::NOT_REQUESTED, $autocomplete->getBrands());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  *
  * @return Model\Autocomplete
  */
 public function createAutocomplete(stdClass $jsonObject)
 {
     return Model\Autocomplete::createFromJson($jsonObject, $this);
 }