1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-14 04:34:07 +02:00

[ticket/15214] Fix rebasing and some other issues

PHPBB3-15214
This commit is contained in:
rxu
2024-06-05 21:58:05 +07:00
parent 8338ff9e56
commit 5e0dc9ef2e
10 changed files with 65 additions and 60 deletions

View File

@@ -16,8 +16,6 @@
*/
class phpbb_functional_extension_controller_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
private static $helper;
protected static $fixtures = array(

View File

@@ -16,8 +16,6 @@
*/
class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
private static $helper;
protected static $fixtures = array(
@@ -47,10 +45,20 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
$this->purge_cache();
}
protected function tearDown(): void
{
$this->uninstall_ext('foo/bar');
parent::tearDown();
}
protected static function setup_extensions()
{
return ['foo/bar'];
}
public function test_load_extension_lang_globally()
{
$this->phpbb_extension_manager->enable('foo/bar');
// The board index, which should contain an overwritten translation
$crawler = self::request('GET', 'index.php');
@@ -59,7 +67,5 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
// language from ext/foo/bar/language/en/foo_global.php
$this->assertStringContainsString('Overwritten by foo', $crawler->filter('.skiplink')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
}

View File

@@ -17,8 +17,6 @@ require_once __DIR__ . '/../../phpBB/includes/acp/acp_modules.php';
*/
class phpbb_functional_extension_module_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
private static $helper;
protected static $fixtures = array(

View File

@@ -16,8 +16,6 @@
*/
class phpbb_functional_extension_permission_lang_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
private static $helper;
protected static $fixtures = array(
@@ -76,7 +74,5 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
// language from ext/foo/bar/language/en/permissions_foo.php
$this->assertStringContainsString('Can view foobar', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
}

View File

@@ -16,8 +16,6 @@
*/
class phpbb_functional_extension_template_event_order_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
static private $helper;
static protected $fixtures = [
@@ -43,11 +41,22 @@ class phpbb_functional_extension_template_event_order_test extends phpbb_functio
{
parent::setUp();
$this->phpbb_extension_manager = $this->get_extension_manager();
$this->purge_cache();
}
protected function tearDown(): void
{
$this->uninstall_ext('foo/bar');
$this->uninstall_ext('foo/foo');
parent::tearDown();
}
protected static function setup_extensions()
{
return ['foo/bar', 'foo/foo'];
}
/**
* Check a controller for extension foo/bar.
*/
@@ -55,32 +64,28 @@ class phpbb_functional_extension_template_event_order_test extends phpbb_functio
{
global $phpbb_root_path;
$this->phpbb_extension_manager->enable('foo/bar');
$this->phpbb_extension_manager->enable('foo/foo');
$crawler = self::request('GET', 'index.php');
$quick_links_menu = $crawler->filter('ul[role="menu"]')->eq(0);
$quick_links_menu_nodes_count = (int) $quick_links_menu->filter('li')->count();
// Ensure foo/foo template event goes before foo/bar one
$this->assertStringContainsString('FOO_FOO_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 2)->filter('span')->text());
$this->assertStringContainsString('FOO_BAR_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 1)->filter('span')->text());
$this->assertStringContainsString('FOO_FOO_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 4)->filter('span')->text());
$this->assertStringContainsString('FOO_BAR_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 3)->filter('span')->text());
// Change template events order to default, put foo/bar event before foo/foo one
$this->phpbb_extension_manager->disable('foo/bar');
$this->phpbb_extension_manager->disable('foo/foo');
$this->disable_ext('foo/bar');
$this->disable_ext('foo/foo');
$this->assertTrue(copy(__DIR__ . '/fixtures/ext/foo/bar/event/template_event_order_higher.php', $phpbb_root_path . 'ext/foo/bar/event/template_event_order.php'));
$this->assertTrue(copy(__DIR__ . '/fixtures/ext/foo/foo/event/template_event_order_lower.php', $phpbb_root_path . 'ext/foo/foo/event/template_event_order.php'));
$this->phpbb_extension_manager->enable('foo/bar');
$this->phpbb_extension_manager->enable('foo/foo');
$this->purge_cache();
sleep(3);
$this->install_ext('foo/bar');
$this->install_ext('foo/foo');
$crawler = self::request('GET', 'index.php');
$quick_links_menu = $crawler->filter('ul[role="menu"]')->eq(0);
$quick_links_menu_nodes_count = (int) $quick_links_menu->filter('li')->count();
// Ensure foo/foo template event goes before foo/bar one
$this->assertStringContainsString('FOO_BAR_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 2)->filter('span')->text());
$this->assertStringContainsString('FOO_FOO_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 1)->filter('span')->text());
$this->phpbb_extension_manager->purge('foo/bar');
$this->phpbb_extension_manager->purge('foo/foo');
$this->assertStringContainsString('FOO_BAR_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 4)->filter('span')->text());
$this->assertStringContainsString('FOO_FOO_QUICK_LINK', $quick_links_menu->filter('li')->eq($quick_links_menu_nodes_count - 3)->filter('span')->text());
}
}

View File

@@ -16,8 +16,6 @@
*/
class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
private static $helper;
protected static $fixtures = array(