mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Initialize phpspec2
This commit is contained in:
parent
9b332c6fd3
commit
b72c5bda99
5 changed files with 59 additions and 5 deletions
4
src/Sylius/Bundle/ResourceBundle/.gitignore
vendored
4
src/Sylius/Bundle/ResourceBundle/.gitignore
vendored
|
|
@ -1,7 +1,5 @@
|
|||
phpunit.xml
|
||||
Tests/autoload.php
|
||||
|
||||
vendor/
|
||||
bin/
|
||||
|
||||
composer.phar
|
||||
composer.lock
|
||||
|
|
|
|||
|
|
@ -9,4 +9,5 @@ before_script: composer install --dev
|
|||
script: php bin/phpspec run
|
||||
|
||||
notifications:
|
||||
email: travis-ci@sylius.org
|
||||
irc: "irc.freenode.org#sylius-dev"
|
||||
email: travis-ci@sylius.org
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@
|
|||
"white-october/pagerfanta-bundle": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/orm": "*"
|
||||
"phpspec/phpspec2": "*"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Sylius\\Bundle\\ResourceBundle": "" }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace spec\Sylius\Bundle\ResourceBundle\Controller;
|
||||
|
||||
use PHPSpec2\ObjectBehavior;
|
||||
|
||||
/**
|
||||
* Request fetcher spec.
|
||||
*
|
||||
* @author Paweł Jędrzejewski <pjedrzejewski@diweb.pl>
|
||||
*/
|
||||
class RequestFetcher extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param Symfony\Component\HttpFoundation\Request $request
|
||||
* @param Symfony\Component\HttpFoundation\ParameterBag $attributeBag
|
||||
*/
|
||||
function let($request, $attributeBag)
|
||||
{
|
||||
$request->attributes = $attributeBag;
|
||||
|
||||
$this->beConstructedWith($request);
|
||||
}
|
||||
|
||||
function it_should_be_initializable()
|
||||
{
|
||||
$this->shouldHaveType('Sylius\Bundle\ResourceBundle\Controller\RequestFetcher');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace spec\Sylius\Bundle\ResourceBundle\Controller;
|
||||
|
||||
use PHPSpec2\ObjectBehavior;
|
||||
|
||||
/**
|
||||
* Resource controller spec.
|
||||
*
|
||||
* @author Paweł Jędrzejewski <pjedrzejewski@diweb.pl>
|
||||
*/
|
||||
class ResourceController extends ObjectBehavior
|
||||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith('sylius_resource', 'test', 'SyliusResourceBundle:Test');
|
||||
}
|
||||
|
||||
function it_should_be_initializable()
|
||||
{
|
||||
$this->shouldHaveType('Sylius\Bundle\ResourceBundle\Controller\ResourceController');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue