peachpie/tests
Jakub Míšek e1d7ae3346 internal: removed "void" type
ref https://github.com/peachpiecompiler/peachpie/issues/638
2020-03-06 00:38:24 +01:00
..
arrays test (array_push) 2020-01-07 14:57:19 +01:00
classes test for indirect new 2020-03-02 14:23:38 +01:00
constants Use __NAMESPACE__ in tests for better maintainability 2019-10-22 14:28:56 +02:00
constructs Add namespaces to script tests 2019-10-21 16:49:45 +02:00
datetime Initialize DateTimeZone with an offset 2019-11-14 00:37:04 +02:00
ftp Skip FTP test when there are no credentials provided 2020-02-07 11:21:42 +01:00
functions better callsite overload resolution for params, test, perf 2020-02-29 17:39:55 +01:00
generators Add namespaces to script tests 2019-10-21 16:49:45 +02:00
gettext Fix sporadic error in gettext test 2020-02-13 14:40:20 +01:00
hash internal: removed "void" type 2020-03-06 00:38:24 +01:00
image test - exif_imagetype(), getimagesize() 2019-10-28 14:08:51 +01:00
openssl TestCorections 2020-02-16 18:25:01 +01:00
operators Fix comparison of array with alias 2020-02-27 16:52:42 +01:00
pcre Make preg_replace_callback test more thorough 2020-02-11 16:57:56 +01:00
pdo PDOStatement + tests 2020-01-07 11:39:57 +01:00
reflection ReflectionFunction::getFileName() works in case there are more overloads 2019-12-20 16:18:43 +01:00
scripting Add namespaces to script tests 2019-10-21 16:49:45 +02:00
spl Implement __serialize/__unserialize in SPL classes 2020-02-15 14:11:21 +01:00
strings test for json decode with assoc and empty array 2019-12-18 23:32:01 +01:00
traits Add namespaces to script tests 2019-10-21 16:49:45 +02:00
transformations Add tests of __clone 2020-02-07 10:40:42 +01:00
variables test for https://github.com/peachpiecompiler/peachpie/issues/684 2020-02-25 23:21:34 +01:00
web FILTER_VALIDATE_INT 2020-02-06 23:34:55 +01:00
xml test for 3d06781cca 2020-02-25 23:21:34 +01:00
zip Add namespaces to script tests 2019-10-21 16:49:45 +02:00
Tests.msbuildproj updated project structure 2020-02-28 23:50:55 +01:00
program.phpx Reduce tests/program.php workarounds 2019-10-22 14:34:52 +02:00
readme.md tests/readme.md 2019-10-24 12:48:28 +02:00

readme.md

This folder contains test files that we compile and run using Peachpie. Eventually the output is compared with what regular PHP returns.

How to run

The tests run automatically on our build servers.

To run the tests locally, use vstest (Visual Studio 2017+) or dotnet test (.NET Core 1.1). The test project is located in /src/Tests/Peachpie.ScriptTests.

Example:

  1. cd ../src/Tests/Peachpie.ScriptTests
  2. dotnet restore
  3. dotnet test

Comparing with PHP

Optionally, the test runner will try to run the php command locally. If you have PHP installed, ensure your php command corresponds to PHP version 7 or newer or the version you would like to compare with Peachpie.

In case an older version of PHP is installed on your system, some PHP7 specific tests will fail.

Guidelines

Note that there are known and intended differences in comparison to regular PHP. The following recommendations should be observed:

  1. avoid UTF-8 BOM in test files
  2. use print_r instead of var_dump
  3. avoid displaying warnings and errors; there are known and intended differences in error handling
  4. put the code into a unique namespace so it will get compiled nicer

Skipped tests

Tests whose name starts with either skip_* or skip(*)_* are skipped. If possible please use the second variant and specify a reason why the test is skipped inside the parentheses.

  • E.g.: skip(late_static_binding_forwarding_not_supported)_static_004.php

* is a wildcard for arbitrary string.