From 7f34032981074757f8047f4078b370df07ee302e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 18 Nov 2018 20:36:36 +0700 Subject: [PATCH] test for ignoring error suppressed by @ --- tests/system/CodeIgniterTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php index ddaec66b331f..b2eb0a6a1d64 100644 --- a/tests/system/CodeIgniterTest.php +++ b/tests/system/CodeIgniterTest.php @@ -258,4 +258,19 @@ public function testTransfersCorrectHTTPVersion() $this->assertEquals(2, $response->getProtocolVersion()); } + public function testIgnoringErrorSuppressedByAt() + { + $_SERVER['argv'] = [ + 'index.php', + '/', + ]; + $_SERVER['argc'] = 2; + + ob_start(); + @unlink('inexistent-file'); + $this->codeigniter->useSafeOutput(true)->run(); + $output = ob_get_clean(); + + $this->assertContains('

Welcome to CodeIgniter

', $output); + } }