evlz / pest-bundle
Symfony2 Pest Bundle
Installs: 1 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- educoder/pest: ~1.0
- symfony/symfony: ~2.4
Requires (Dev)
- phpunit/phpunit: ~4.5
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