From 42b7782927713c2ca2fb704db6217016347b586e Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 19 Mar 2017 21:46:20 +0700 Subject: [ticket/14972] Migrate from deprecated getMock() method to createMock() PHPBB3-14972 --- tests/event/exception_listener_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/event') diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php index 08679a3ed8..fbae9e25b7 100644 --- a/tests/event/exception_listener_test.php +++ b/tests/event/exception_listener_test.php @@ -84,7 +84,7 @@ class exception_listener extends phpbb_test_case $exception_listener = new \phpbb\event\kernel_exception_subscriber($template, $lang); - $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception); + $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception); $exception_listener->on_kernel_exception($event); $response = $event->getResponse(); -- cgit v1.2.1 From ebac54aa9e705e99a562d2fe2c0f57bc6af8dd32 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Dec 2018 11:36:08 +0100 Subject: [ticket/14948] Adjust calls for twig and phpunit updates PHPBB3-14948 --- tests/event/export_php_test.php | 2 +- tests/event/php_exporter_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/event') diff --git a/tests/event/export_php_test.php b/tests/event/export_php_test.php index 21bbb0620a..92280b6f4f 100644 --- a/tests/event/export_php_test.php +++ b/tests/event/export_php_test.php @@ -16,7 +16,7 @@ class phpbb_event_export_php_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index c6670e1340..78beb9f372 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -16,7 +16,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); $this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/'); -- cgit v1.2.1 From 90f8498a4488e7f28ee7741cb9245ff232489127 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 6 Jan 2018 11:01:40 -0800 Subject: [ticket/15369] Fix php_exporter tests PHPBB3-15369 --- tests/event/php_exporter_test.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'tests/event') diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index 78beb9f372..5c9e20aa7d 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -122,7 +122,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case static public function crawl_php_file_throws_data() { return array( - array('missing_var.test', null), + array('missing_var.test', 2), array('duplicate_event.test', 10), ); } @@ -132,7 +132,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_crawl_php_file_throws($file, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->crawl_php_file($file); } @@ -206,7 +207,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_validate_event_throws($event_name, $event, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->validate_event($event_name, $event); } @@ -461,7 +463,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_get_vars_from_array_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -546,7 +549,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_get_vars_from_docblock_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -649,7 +653,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_find_since_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -750,7 +755,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_find_description_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); -- cgit v1.2.1