Ejemplo n.º 1
0
 public function testFilters()
 {
     $articles = new Articles();
     $validFilters = array(Articles::SORT_ACTIVATION_DATE, Articles::SORT_POPULARITY, Articles::SORT_PRICE_ASC, Articles::SORT_PRICE_DESC, Articles::SORT_SALE);
     foreach ($validFilters as $validFilter) {
         $articles->setSort($validFilter);
         $this->assertEquals($validFilter, $articles->getSort());
     }
 }
 /**
  * @expectedException BadFunctionCallException
  */
 public function testAbstractOperationInvalidMethodName()
 {
     $articles = new Articles();
     $articles->foo();
 }
Ejemplo n.º 3
0
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'bootstrap.php';
use ZalandoPHP\ZalandoPHP;
use ZalandoPHP\Configuration\GenericConfiguration;
use ZalandoPHP\Operations\Articles;
$conf = new GenericConfiguration();
try {
    $conf->setLocale('nl-BE')->setClientName('zalando-php-wrapper')->setResponseType('array')->setTimeout(12)->setConnectionTimeout(45);
} catch (\Exception $e) {
    echo $e->getMessage();
}
$zalandoPHP = new ZalandoPHP($conf);
$articles = new Articles();
//$articles->setColor('red,green');
//$articles->setBrand('BE1,ME1');
//$articles->setPage(3);
//$articles->setPageSize(5);
$articles->setCategory('baby-accessoires,baby-accessoires-promo,babys-schoenen,babys-schoenen-promo,babyslaapzak,babyslaapzak-promo,babyslofjes,babyslofjes-promo,kinderkleding-baby-ondergoed-rompers,kinderkleding-baby-ondergoed-rompers-promo,luxe-baby-accessoires');
$formattedResponse = $zalandoPHP->runOperation($articles);
echo '<pre>';
print_r($formattedResponse);
echo '</pre>';