Exemple #1
0
 /**
  * @inheritdoc
  */
 protected function getAllowedFields($resource)
 {
     switch ($resource) {
         case 'pets':
             return ['name', 'family', 'store'];
         case 'stores':
             return ['name'];
         default:
             return parent::getAllowedFields($resource);
     }
 }
 /**
  * @test
  */
 public function shouldNotBeEmptyIfOneOfParameterWasSpecified()
 {
     $query1 = new QueryParameters();
     $this->assertTrue($query1->isEmpty());
     $query1->setIncludePaths(['store', 'store.owner']);
     $this->assertFalse($query1->isEmpty());
     $query2 = new QueryParameters();
     $query2->setFieldSets(['pets' => ['name', 'family']]);
     $this->assertFalse($query2->isEmpty());
 }