[ticket/13008] Add functionnal test

PHPBB3-13008
This commit is contained in:
Tristan Darricau 2014-08-23 13:16:41 +02:00
parent 03b9eb5dcb
commit 0386b1788a
7 changed files with 68 additions and 0 deletions

View file

@ -26,6 +26,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
'foo/bar/event/',
'foo/bar/language/en/',
'foo/bar/styles/prosilver/template/',
'foo/foo/config/',
'foo/foo/controller/',
);
static public function setUpBeforeClass()
@ -64,6 +66,18 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
$this->phpbb_extension_manager->purge('foo/bar');
}
/**
* Check a controller for extension foo/bar.
*/
public function test_routing_resources()
{
$this->phpbb_extension_manager->enable('foo/foo');
$crawler = self::request('GET', 'app.php/foo/foo', array(), false);
self::assert_response_status_code();
$this->assertContains("foo/foo controller handle() method", $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/foo');
}
/**
* Check the output of a controller using the template system
*/

View file

@ -0,0 +1,24 @@
{
"name": "foo/foo",
"type": "phpbb-extension",
"description": "Testing extensions",
"homepage": "",
"version": "1.0.0",
"time": "2013-03-21 01:01:01",
"license": "GPL-2.0",
"authors": [{
"name": "Tristan Darricau",
"email": "nicofuma@phpbb.com",
"homepage": "http://www.phpbb.com",
"role": "Developer"
}],
"require": {
"php": ">=5.3"
},
"extra": {
"display-name": "phpBB 3.1 Extension Testing",
"soft-require": {
"phpbb/phpbb": "3.1.*@dev"
}
}
}

View file

@ -0,0 +1,3 @@
foo_foo_controller:
pattern: /foo
defaults: { _controller: foo_foo.controller:handle }

View file

@ -0,0 +1,3 @@
foo_foo.general:
resource: "resource.yml"
prefix: /foo

View file

@ -0,0 +1,3 @@
services:
foo_foo.controller:
class: foo\foo\controller\controller

View file

@ -0,0 +1,13 @@
<?php
namespace foo\foo\controller;
use Symfony\Component\HttpFoundation\Response;
class controller
{
public function handle()
{
return new Response('foo/foo controller handle() method', 200);
}
}

View file

@ -0,0 +1,8 @@
<?php
namespace foo\foo;
class ext extends \phpbb\extension\base
{
}