evlz/pest-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony2 Pest Bundle

0.3.1 2015-03-09 19:40 UTC

This package is auto-updated.

Last update: 2022-02-01 12:30:47 UTC


README

Symfony2 Bundle

Service for https://github.com/educoder/pest

Installation and configuration:

Get the bundle

Add to your evlz-pest-bundle to your dependencies:

{

    "require": {
        "evlz/pest-bundle": "~1.0"

    }

}

To install, run php composer[.phar] [update|install].

Add EvlzPestBundle to your application kernel

// app/AppKernel.php

public function registerBundles()

{

    return array(

        // ...

        new Evlz\PestBundle\EvlzPestBundle(),

        // ...

    );

}

You can get the pest service simply by using the container. From your controller you can do:

$baseUrl = 'http://gdata.youtube.com';

// get service

$rest = $this->get('evlz_pest.rest');

// create client. \PestJSON by default

$client = $rest->createClient($baseUrl);

// create \Pest client

$clientType = \Evlz\PestBundle\Entity\Factory::TYPE_MAIN;//
$client = $rest->createClient($baseUrl, $clientType);

// create \Pest client. forced re-creation

$clientType = \Evlz\PestBundle\Entity\Factory::TYPE_JSON;//
$client = $rest->createClient($baseUrl, $clientType, true);

Tests


% phpunit src/Evlz/PestBundle/Tests/Entity/RestTest.php
% phpunit src/Evlz/PestBundle/Tests/Entity/DataConverterTest.php

Please, see https://github.com/educoder/pest for details