From ee472c41b394162a6c27db60bcdda097f90f2ed7 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 13 Aug 2026 06:42:26 -0700 Subject: [PATCH] Test updates --- tests/controller/main_test.php | 2 +- tests/dbal/simple_test.php | 5 +++-- tests/functional/view_test.php | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/controller/main_test.php b/tests/controller/main_test.php index a036568..d9f7dae 100644 --- a/tests/controller/main_test.php +++ b/tests/controller/main_test.php @@ -46,7 +46,7 @@ public function test_handle($status_code, $page_content) // Set language->lang() to return any arguments sent to it $language->method('lang') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); /** @var \phpbb\controller\helper|\PHPUnit\Framework\MockObject\MockObject $controller_helper Mock the controller helper class */ $controller_helper = $this->getMockBuilder('\phpbb\controller\helper') diff --git a/tests/dbal/simple_test.php b/tests/dbal/simple_test.php index 2d5d758..8be7f08 100644 --- a/tests/dbal/simple_test.php +++ b/tests/dbal/simple_test.php @@ -45,9 +45,10 @@ public function test_column() } else { - // This is how to instantiate db_tools in phpBB 3.2 + // This is how to instantiate db_tools in phpBB 3.2 and beyond $factory = new \phpbb\db\tools\factory(); - $db_tools = $factory->get($this->db); + $db = method_exists($this, 'new_doctrine_dbal') ? $this->new_doctrine_dbal() : $this->db; + $db_tools = $factory->get($db); } $this->assertTrue($db_tools->sql_column_exists(USERS_TABLE, 'user_demo'), 'Asserting that column "user_demo" exists'); diff --git a/tests/functional/view_test.php b/tests/functional/view_test.php index df0c9ae..6c47a1d 100644 --- a/tests/functional/view_test.php +++ b/tests/functional/view_test.php @@ -29,7 +29,7 @@ protected static function setup_extensions() */ public function test_view_foo() { - $crawler = self::request('GET', 'app.php/demo/foo'); + $crawler = self::request('GET', 'demo/foo'); $this->assertStringContainsString('foo', $crawler->filter('h2')->text()); $this->add_lang_ext('acme/demo', 'common'); @@ -45,7 +45,7 @@ public function test_view_foo() */ public function test_view_bar() { - $crawler = self::request('GET', 'app.php/demo/bar'); + $crawler = self::request('GET', 'demo/bar'); $this->assertStringNotContainsString('foo', $crawler->filter('h2')->text()); $this->assertStringContainsString('bar', $crawler->filter('h2')->text()); }