[PR #232] [MERGED] Small fix to test bootstrap #1016

Closed
opened 2026-03-04 03:03:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/232
Author: @adlawson
Created: 9/17/2013
Status: Merged
Merged: 9/17/2013
Merged by: @Seldaek

Base: masterHead: fix-bootstrap


📝 Commits (1)

  • 5d36b5d Fix test bootstrap autoloader

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 tests/bootstrap.php (+1 -1)

📄 Description

The previous require_once statement returns true when it loads the autoload file rather than an instance of ClassLoader. Changing the statement to require returns the instance needed to add the Monolog test directory.

PHP Fatal error:  Call to a member function add() on a non-object in /srv/tests/bootstrap.php on line 13
PHP Stack trace:
PHP   1. {main}() /srv/vendor/phpunit/phpunit/composer/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /srv/vendor/phpunit/phpunit/composer/bin/phpunit:63
PHP   3. PHPUnit_TextUI_Command->run() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_Command->handleArguments() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:138
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:606
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:778
PHP   7. PHPUnit_Util_Fileloader::load() /srv/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:76
PHP   8. include_once() /srv/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:92

The issue was witnessed on PHP 5.5.3:

PHP 5.5.3-1+debphp.org~precise+2 (cli) (built: Aug 27 2013 09:15:48)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/232 **Author:** [@adlawson](https://github.com/adlawson) **Created:** 9/17/2013 **Status:** ✅ Merged **Merged:** 9/17/2013 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `fix-bootstrap` --- ### 📝 Commits (1) - [`5d36b5d`](https://github.com/Seldaek/monolog/commit/5d36b5df7a59a2e47b6ac289ac4dc02d0ed9a7d6) Fix test bootstrap autoloader ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/bootstrap.php` (+1 -1) </details> ### 📄 Description The previous `require_once` statement returns `true` when it loads the autoload file rather than an instance of `ClassLoader`. Changing the statement to `require` returns the instance needed to add the Monolog test directory. ``` bash PHP Fatal error: Call to a member function add() on a non-object in /srv/tests/bootstrap.php on line 13 PHP Stack trace: PHP 1. {main}() /srv/vendor/phpunit/phpunit/composer/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /srv/vendor/phpunit/phpunit/composer/bin/phpunit:63 PHP 3. PHPUnit_TextUI_Command->run() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_TextUI_Command->handleArguments() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:138 PHP 5. PHPUnit_TextUI_Command->handleBootstrap() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:606 PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() /srv/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:778 PHP 7. PHPUnit_Util_Fileloader::load() /srv/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:76 PHP 8. include_once() /srv/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:92 ``` The issue was witnessed on PHP 5.5.3: ``` bash PHP 5.5.3-1+debphp.org~precise+2 (cli) (built: Aug 27 2013 09:15:48) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:03:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1016
No description provided.