![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/vendor/aweber/aweber/tests/ |
<?php $errors = array(); /** * simple hook to record all errors in a testable way. */ function myErrorHandler($type, $msg, $errfile, $errline) { global $errors; array_push($errors, array('type' => $type, 'msg' => $msg)); } class TestMultipleInstalledVersions extends PHPUnit_Framework_TestCase { public function setUp() { global $errors; $errors = array(); } /** * tests that multiple includes would raise a E_USER_WARNING */ public function test_multiple_includes() { global $errors; set_error_handler("myErrorHandler"); include("aweber_api/aweber_api.php"); restore_error_handler(); $this->assertEquals(count($errors), 1); $this->assertEquals($errors[0]['type'], E_USER_WARNING); $this->assertEquals($errors[0]['msg'], 'Duplicate: Another AWeberAPI client library is already in scope.'); } } ?>