mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13008] Add functionnal test
PHPBB3-13008
This commit is contained in:
parent
03b9eb5dcb
commit
0386b1788a
7 changed files with 68 additions and 0 deletions
|
@ -26,6 +26,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
||||||
'foo/bar/event/',
|
'foo/bar/event/',
|
||||||
'foo/bar/language/en/',
|
'foo/bar/language/en/',
|
||||||
'foo/bar/styles/prosilver/template/',
|
'foo/bar/styles/prosilver/template/',
|
||||||
|
'foo/foo/config/',
|
||||||
|
'foo/foo/controller/',
|
||||||
);
|
);
|
||||||
|
|
||||||
static public function setUpBeforeClass()
|
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');
|
$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
|
* Check the output of a controller using the template system
|
||||||
*/
|
*/
|
||||||
|
|
24
tests/functional/fixtures/ext/foo/foo/composer.json
Normal file
24
tests/functional/fixtures/ext/foo/foo/composer.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
foo_foo_controller:
|
||||||
|
pattern: /foo
|
||||||
|
defaults: { _controller: foo_foo.controller:handle }
|
3
tests/functional/fixtures/ext/foo/foo/config/routing.yml
Normal file
3
tests/functional/fixtures/ext/foo/foo/config/routing.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
foo_foo.general:
|
||||||
|
resource: "resource.yml"
|
||||||
|
prefix: /foo
|
|
@ -0,0 +1,3 @@
|
||||||
|
services:
|
||||||
|
foo_foo.controller:
|
||||||
|
class: foo\foo\controller\controller
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
8
tests/functional/fixtures/ext/foo/foo/ext.php
Normal file
8
tests/functional/fixtures/ext/foo/foo/ext.php
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace foo\foo;
|
||||||
|
|
||||||
|
class ext extends \phpbb\extension\base
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue