예제 #1
0
 /** Run the service and set result. */
 protected function proceed()
 {
     switch ($this->action) {
         case 'get':
             $this->succeed(AttributesService::get($this->params['id']));
             break;
         case 'getAll':
             $this->succeed(AttributesService::getAll());
             break;
     }
 }
 /** @depends testCreateSet
  * @depends testReadEmptySet
  */
 public function testReadSet()
 {
     $set = new AttributeSet("set");
     $attr = new Attribute("attr", 1);
     $attrId = AttributesService::createAttribute($attr);
     $attr->id = $attrId;
     $set->addAttribute($attr);
     $id = AttributesService::createSet($set);
     $read = AttributesService::get($id);
     $this->assertNotNull($read, "Nothing found");
     $this->assertEquals(1, count($read->attributes));
     $this->assertEquals($attr->id, $read->attributes[0]->id, "Attribute id mismatch");
     $this->assertEquals($attr->label, $read->attributes[0]->label, "Attribute label mismatch");
     $this->assertEquals($attr->dispOrder, $read->attributes[0]->dispOrder, "Display order mismatch");
 }