Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain bug ID's in filename #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Book/tests/phpt_file_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ Writing a simple test

Let's write our first test just to get familiar with the process.

If you ever encounter a bug in PHP or an extension, the first thing you should do is write a specific test for it. Put
the ID of the bug from bugs.php.net in the filename, eg: bug12345.phpt. This makes it easy for the developers to
reproduce the bug and all future versions of PHP will keep testing for this specific bug, making sure it will never
reoccur in the future.

Typically tests are stored in a ``tests/`` directory that lives near the code we want to test. For example, the `PDO
extension`_ is found at ``ext/pdo`` in the PHP source code. If you open that directory, you'll see a `tests/ directory`_
with lots of ``.phpt`` files in it. All the other extensions are set up the same way. There are also tests for the Zend
Expand Down