SimpleTest is a framework for unit testing, web site testing and mock objects for PHP

Overview

SimpleTest Build Status Latest Stable Version Total Downloads

SimpleTest is a framework for unit testing, web site testing and mock objects for PHP.

Installation

Downloads

All downloads are stored on Github Releases.

You may find the zip of the "latest released/tagged version" here:

https://github.com/simpletest/simpletest/releases/latest

You may find the zip archive of the "dev-master" branch here:

https://github.com/simpletest/simpletest/archive/master.zip

Composer

You may also install the extension through Composer into the /vendor folder of your project.

Either run

php composer.phar require --prefer-dist simpletest/simpletest "^1.1"

or add the package simpletest/simpletest to the require-dev section of your composer.json file:

{
    "require-dev": {
        "simpletest/simpletest": "^1.1"
    }
}

followed by running composer install.

Issues

Please report all issues you encounter at Github Issues.

Community

Feel free to ask a new question on Stack Overflow or at Github Issues.

StackOverflow offers also a good collection of SimpleTest related questions.

Requirements

PHP 7.1+

Authors

License

GNU LGPL v2.1

Tests

The unit tests for SimpleTest itself can be run here:

test/all_tests.php

The acceptance tests require a running server:

- php -S localhost:8080 -t test/site
- test/acceptance_test.php

Docs

http://simpletest.org/en/first_test_tutorial.html
Comments
  • Website seems to be outdated

    Website seems to be outdated

    The first thing you see when you get to the website is:

    [23/01/2012] SimpleTest 1.1.0 is available. It's the first release in maintenance mode.

    (emphasis on date mine)

    Whilst it may be true that 1.1.0 is still the only version in maintenance mode, that date is really old now. I was really happy to see that there's a Github account with activity. I only discovered this after coming across a Stack Overflow answer that mentioned the project is not abandoned.

    That made me really happy as I looked for a long time to find something like this for my own testing and fell in love. I think for the sake of others who will come across the website and not realise there's activity, the above block should be moved to a less prominent location and an indicator put in off activity. Perhaps one of those snazzy "fork me on Github" banners everyone seems to like these days?

    Fork me on Github ribbon

    If you'd like some help with the site I'd be happy to help out or put in some PRs if you make it a public repo.

    feature request 
    opened by jeteon 9
  • composer warning: Ambiguous class resolution; file for autoloading is chosen at random

    composer warning: Ambiguous class resolution; file for autoloading is chosen at random

    Warning: Ambiguous class resolution, "SimpleReflection" was found in both "vendor/simpletest/simpletest/reflection_php4.php" and "vendor/simpletest/simpletest/reflection_php5.php", the first will be used.

    Composer seems to iterate in filesystem order, so this class effectively gets chosen at random on each distinct installation, although the php5 variant is the correct one in my environment.

    I don't think this makes a difference (the class isn't actually autoloaded, so if the wrong one was in the autoloader, nothing bad happens) unless client code accidentally triggers the autoload before SimpleTest gets a chance to do its own direct loading. Still, I would like the warning to be fixed.

    In fact, I think the php4 file can just be deleted. composer.json and the bundled docs both say 1.1+ are PHP5-only, and I can't find anywhere that would load the php4 variant.

    opened by sapphirecat 9
  • New Release / Project Status

    New Release / Project Status

    I would like to inquire about the status of simpletest. The last release was in October of 2015, so getting close to 2 years ago now. I'm guessing there are 4 possibilities as to why this is. 1) The code has been unfit for release since then. 2) There have not been significant enough changes to warrant a release. 3) The project is not actively maintained enough for someone to prepare a release even though they are believed in by the maintainer. 4) You don't believe in releases and always consider the master branch to be the latest release and fit for use.

    question 
    opened by still-dreaming-1 8
  • Using percent sign in assert message

    Using percent sign in assert message

    Because of message formatting uses sprinf, assert methods fail if the message contains percent sign:

    Unexpected PHP Error [sprintf(): Too few arguments] severity [2] in [/media/sf_projects/html/simpletest2/test_case.php line 311]

    bug 
    opened by michalk-k 8
  • i would like commit some code

    i would like commit some code

    `diff --git a/browser.php b/browser.php index 09aa295..ec25d84 100644 --- a/browser.php +++ b/browser.php @@ -248,7 +248,8 @@ class SimpleBrowser }

     /**
    
    • * Switches back on the cookie sending and recieving.
      
    • *    Switches back on the cookie sending and recieving.
      
    • *    @access public
      */
      

      public function useCookies() { @@ -256,6 +257,27 @@ class SimpleBrowser }

      /**

    • *    Get current list of cookies
      
    • *    @access public
      
    • *    @return array
      
    • */
      
    • public function getCookies()

    • {

    •    return $this->user_agent->getCookies();
      
    • }

    • /**

    • *    Import a list of cookies
      
    • *    @access public
      
    • *    @param array
      
    • */
      
    • public function setCookies(array $lstCookies)

    • {

    •    return $this->user_agent->setCookies($lstCookies);
      
    • }

    • /**

      • Parses the raw content into a page.
      • Will load further frame pages unless frames are disabled.

    diff --git a/cookies.php b/cookies.php index ed25d08..dfff5d9 100644 --- a/cookies.php +++ b/cookies.php @@ -288,6 +288,16 @@ class SimpleCookieJar }

     /**
    
    • *    Return a list of the current cookies
      
    • *    @access public
      
    • *    @return array
      
    • */
      
    • public function getCookies()

    • {

    •    return $this->cookies;
      
    • }

    • /**

      • Finds a matching cookie to write over or the first empty slot if none.
      • @param SimpleCookie $cookie Cookie to write into jar. diff --git a/user_agent.php b/user_agent.php index e35da5d..dd66057 100644 --- a/user_agent.php +++ b/user_agent.php @@ -97,6 +97,45 @@ class SimpleUserAgent }

      /**

    • *    Get current list of cookies
      
    • *    @access public
      
    • *    @return array
      
    • */
      
    • public function getCookies()

    • {

    •    $lstCookies = $this->cookie_jar->getCookies();
      
    •    $aCookies = [];
      
    •    foreach($lstCookies as $oCookies) {
      
    •        $aCookies[] = [
      
    •            'name'=>$oCookies->getName(),
      
    •            'value'=>$oCookies->getValue(),
      
    •            'host'=>$oCookies->getHost(),
      
    •            'path'=>$oCookies->getPath(),
      
    •            'expiry'=>$oCookies->getExpiry(),
      
    •        ];
      
    •    }
      
    •    return $aCookies;
      
    • }

    • /**

    • *    Import a list of cookies
      
    • *    @access public
      
    • *    @param array
      
    • */
      
    • public function setCookies(array $lstCookies)

    • {

    •    foreach($lstCookies as $aCookies) {
      
    •            $this->cookie_jar->setCookie(
      
    •            $aCookies['name'],
      
    •            $aCookies['value'],
      
    •            $aCookies['host'],
      
    •            $aCookies['path'],
      
    •            $aCookies['expiry']
      
    •        );
      
    •    }
      
    • }

    • /**

      • Reads the most specific cookie value from the browser cookies.
      • @param string $host Host to search. `
    opened by didungar 6
  • Fix for error on getTagName() object

    Fix for error on getTagName() object

    Hi, I came across this issue and fixed it by adding is_object to $this->private_content_tag before executing the $this->private_content_tag->getTagName() method. Below is the error message. Please update.

    PHP Fatal error: Call to a member function getTagName() on a non-object in /vendor/simpletest/simpletest/php_parser.php on line 876

    bug 
    opened by miradnan 5
  • Dynamic method called as static

    Dynamic method called as static

    Hello,

    I think there is a problem with some dynamic methods that are called as static methods. And calling a dynamic method statically generates the E_STRICT error with PHP 5. Could you please check that and update Simpletest?

    The following dynamic methods are called statically:

    • Class PageRequest, methods get() and post()
    • Class DOMDocument, method loadHTML
    vendor/simpletest/simpletest/test/site/front_controller_style/show_request.php:21
    vendor/simpletest/simpletest/test/site/front_controller_style/show_request.php:35
    vendor/simpletest/simpletest/test/site/path/network_confirm.php:41
    vendor/simpletest/simpletest/test/site/network_confirm.php:41
    vendor/simpletest/simpletest/test/site/protected/network_confirm.php:41
    vendor/simpletest/simpletest/test/site/path/network_confirm.php:55
    vendor/simpletest/simpletest/test/site/protected/network_confirm.php:55
    vendor/simpletest/simpletest/test/site/network_confirm.php:61
    vendor/simpletest/simpletest/extensions/coverage/test/coverage_calculator_test.php:70
    vendor/simpletest/simpletest/extensions/coverage/test/simple_coverage_writer_test.php:71
    

    This issue is similar to issue #2.

    Thanks ;)

    Guillaume

    bug 
    opened by guicara 5
  • Status & Todo

    Status & Todo

    I've done some commits to get SimpleTest up and running on Travis-CI. This build is the first green one after a long time. And yes, it's green on PHP 7 ;) https://travis-ci.org/simpletest/simpletest/builds/73022256


    Warning: tl;tr

    • I've disabled the acceptance_tests. They do live tests against lastcraft.com, which is down. This needs to be changed:
    • fire up PHP server or Nginx over at Travis
    • serve the tests folder for the acceptance tests
    • alter the lastcraft.com to localhost
    • The Mock object creation is still a mess. Some mocks use the method name of their class as constructors. This will be deprecated soon and is now a warning.
    • I've prefixed several failing tests with "TODO_". Some of them are related to the SimpleTestCompatibility::isReference() function. I think the reference detection needs an adjustment to work with newer PHP versions.
    • I've dropped several PHP version comparisons and guards with the intention to raise the minimum PHP version to PHP 5.4. All lower PHP versions are EOL and PHP5.4 itself is EOL at the end of 2015.
    • I've also removed several compatibility functions and inserted the native functionality at the position of the call to the compat functions.

    Regards, Jens

    opened by jakoch 5
  • [support] How to structure integration tests

    [support] How to structure integration tests

    I must be missing a trick with structuring my integration tests. I have classes for running specific tests based on input, but now I want to test different classes together and running into problems. I first tried inheritence but quickly realised that approach was limited when I needed to use more than 1 test class (e.g. fooTest, barTest). I only want to run every 'test' method in bazTest, while fooTest and barTest just provide useful abstractions so that bazTest is short and understandable.

    What I'm trying now is failing with Fatal error: Call to a member function getDumper() on a non-object in /srv/example.com/htdocs/simpletest/test_case.php on line 345

    class bazTest extends UnitTestCase {
        function testStart() {
            $this->foo = new fooTest();
        }
        function testDo() {
            $this->foo->doFoo(true);
        }
    }
    class fooTest extends UnitTestCase {
        function doFoo($foo) {        $this->assertTrue($foo);    }
    }
    class barTest extends UnitTestCase {
        function doBar($bar) {        $this->assertTrue($bar);    }
    }
    

    I guess I'm misunderstanding some concepts, but I thought I remember reading that SimpleTest can do Integration tests and not only Unit tests..

    support 
    opened by aland 4
  • Should parse first base and title tags only

    Should parse first base and title tags only

    It is important to only parse the first title tag. One might think an HTML file can only contain a single tag, but actually embedded SVG (within an svg tag) may provide its own title, and we do not want to be capturing that.

    opened by chrisgraham 3
  • Syntax error in mocked methods in PHP 7.1+

    Syntax error in mocked methods in PHP 7.1+

    Replacing my ancient bug report with an up-to-date one:

    reflection.php has code for generating a nullable return type in a method signature, but the code seems to have 2 problems:

    1. It doesn't actually use allowsNull() on the return type object, so it looks like all types would be marked nullable
    2. More relevantly, It doesn't check to see if getReturnType returns null (or is empty string in the casted-to-string form it's currently being used), so in that case it generates a signature with just a floating : ?, which causes a syntax error when the code gets eval'd in a mock class.

    Just removing the whole block removes the syntax error and is probably a step forward.

    bug 
    opened by zerocrates 3
  • Enable mock objects tests

    Enable mock objects tests

    This partially fixes running HTMLPurifier tests on PHP 8 (https://github.com/ezyang/htmlpurifier/issues/278), specifically:

    Fatal error: Abstract function HTMLPurifier_AttrDefTestable::validate() cannot contain body in /pwd/simpletest/src/mock_objects.php(1417) : eval()'d code on line 138
    

    There are issues with the references tests which I've commented out, and I would be grateful for your assistance in resolving those issues. The broken references tests are also blocking HTMLPurifier:

    All HTML Purifier tests on PHP 8.0.6
    1) [Object: of HTMLPurifier_DefinitionCache_Serializer] and [Object: of HTMLPurifier_DefinitionCache_Serializer] should reference the same object at [/v/tests/HTMLPurifier/DefinitionCacheFactoryTest.php line 52]
            in test_create_recycling
            in HTMLPurifier_DefinitionCacheFactoryTest
    2) [Object: of HTMLPurifier_ElementDef] and [Object: of HTMLPurifier_ElementDef] should reference the same object at [/v/tests/HTMLPurifier/HTMLModuleTest.php line 42]
            in test_addElement
            in HTMLPurifier_HTMLModuleTest
    3) [Object: of HTMLPurifier_ElementDef] and [Object: of HTMLPurifier_ElementDef] should reference the same object at [/v/tests/HTMLPurifier/HTMLModuleTest.php line 115]
            in test_addBlankElement
            in HTMLPurifier_HTMLModuleTest
    4) [Object: of HTMLPurifier] and [Object: of HTMLPurifier] should reference the same object at [/v/tests/HTMLPurifierTest.php line 46]
            in testGetInstance
            in HTMLPurifierTest
    FAILURES!!!
    Test cases run: 220/220, Passes: 2780, Failures: 4, Exceptions: 0
    
    opened by bytestream 0
  • Failed unit_tests.php

    Failed unit_tests.php

    Just installed simpleTest 1.1.7 on the XAMPP htdocs directory on Windows 7(unziping to it) and got this message after running unit_tests.php. Is there a need to configure any dependency ?

    unit_tests.php Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]

    Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]

    Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]

    Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0

    C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1

    C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3

    C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4

    C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleExceptionTrappingInvoker->invoke('testMockedInter...') #5

    C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7 in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code on line 10

    When install through Composer, I get this:

    unit_tests.php Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512] Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512] Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774] Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774]

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpl in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code on line 10

    opened by rafael-anschau 2
  • TestSuite ends up creating instances of the clases in the hiearchy of a test

    TestSuite ends up creating instances of the clases in the hiearchy of a test

    Hi,

    We're having an issue with the way classes are handled when building a TestSuite.

    We have a hierarchy of test classes that eventually derive from testcase. Some of the classes in the hierarchy are abstract, but other aren't. When the TestSuite is built, the non-abstract classes are added to the TestSuite and an instance of them is constructed. Those classes don't have test methods, so only the constructor is run. The problem is that their constructors perform a long initialization, which is run multiple times (once for each 'parent' class created).

    Our hierarchy of classes is something like:

    abstract class BaseTest extends UnitTestCase {} class CommonTest extends BaseTest {} class TestWithDb extends CommonTest {} class ATest extends TestWithDb {}

    When we try to run ATest, three instances are created: one of ATest (as expected), but also one of TestWithDb and one of CommonTest.

    My question is what is the rationale behind it? If the class of the test has a parent class, why is the latter instantiated on its own?

    The sequence of the code is:

    In SimpleFileLoader:

    public function load($test_file)
    {
        $existing_classes = get_declared_classes();
        $existing_globals = get_defined_vars();
        include_once($test_file);
        $new_globals = get_defined_vars();
        $this->makeFileVariablesGlobal($existing_globals, $new_globals);
        $new_classes = array_diff(get_declared_classes(), $existing_classes);
        if (empty($new_classes)) {
            $new_classes = $this->scrapeClassesFromFile($test_file);
        }
        $classes = $this->selectRunnableTests($new_classes);
    
        return $this->createSuiteFromClasses($test_file, $classes);
    

    }

    scrapeClassesFromFile(): finds all the classes of our hierarchy. selectRunnableTests(): marks as ignored only abstract classes createSuiteFromClasses(): ignores only the parent of ignored classes, creates one instance of the remaining ones.

    Regards,

    Alejandro

    opened by alejandro-rusell 0
  • how to click href  when there is nowrap

    how to click href when there is nowrap

    I was trying to click the href for the following code

    <td  align="right" nowrap="nowrap">
    <a href="newaccout.do">My Details</a>
    </td>
    

    $browser->click("My Details"); and it redirect to another page. So I am unable to process next.

    opened by bishu 0
  • Please support cookie/session

    Please support cookie/session

    The following is the web test post request header, please bring a cookie in each request, otherwise can not keep session ----Translation from Google translation

    HTTP/1.1 200 OK Date: Wed, 20 Sep 2017 10:01:08 GMT Server: Apache/2.4.27 (Debian) Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Content-Length: 105 Connection: close Content-Type: application/json; charset=utf-8

    feature request 
    opened by lxshui 1
Releases(v1.2.0)
Owner
SimpleTest
Unit Testing for PHP
SimpleTest
Mock HTTP requests on the server side in your PHP unit tests

HTTP Mock for PHP Mock HTTP requests on the server side in your PHP unit tests. HTTP Mock for PHP mocks the server side of an HTTP request to allow in

InterNations GmbH 386 Dec 27, 2022
Mockery - Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library

Mockery Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its c

Mockery 10.3k Jan 1, 2023
The modern, simple and intuitive PHP unit testing framework.

atoum PHP version atoum version 5.3 -> 5.6 1.x -> 3.x 7.2 -> 8.x 4.x (current) A simple, modern and intuitive unit testing framework for PHP! Just lik

atoum 1.4k Nov 29, 2022
PHP unit testing framework with built in mocks and stubs. Runs in the browser, or via the command line.

Enhance PHP A unit testing framework with mocks and stubs. Built for PHP, in PHP! Quick Start: Just add EnhanceTestFramework.php and you are ready to

Enhance PHP 67 Sep 12, 2022
The PHP Unit Testing framework.

PHPUnit PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. Installat

Sebastian Bergmann 18.8k Jan 4, 2023
Very simple mock HTTP Server for testing Restful API, running via Docker.

httpdock Very simple mock HTTP Server for testing Restful API, running via Docker. Start Server Starting this server via command: docker run -ti -d -p

Vo Duy Tuan 4 Dec 24, 2021
Mock implementation of the Translation package, for testing with PHPUnit

PoP Translation - Mock Mock implementation of the Translation package, for testing with PHPUnit Install Via Composer composer require getpop/translati

PoP 1 Jan 13, 2022
Unit testing tips by examples in PHP

Unit testing tips by examples in PHP Introduction In these times, the benefits of writing unit tests are huge. I think that most of the recently start

Kamil RuczyƄski 894 Jan 4, 2023
Real-world Project to learning about Unit Testing/TDD with Laravel for everybody

KivaNote - a Laravel TDD Sample Project Let me introduce you to KivaNote, a simple real-world application using Laravel to show you how the TDD & Unit

(Seth) Phat Tran 10 Dec 31, 2022
Package for unit testing Laravel form request classes

Package for unit testing Laravel form request classes. Why Colin DeCarlo gave a talk on Laracon online 21 about unit testing Laravel form requests cla

null 18 Dec 11, 2022
Learn unit testing with PHPUnit.

PHPUnit Exercise Running PHPUnit ./vendor/bin/phpunit # with filter which tests to run ./vendor/bin/phpunit --filter <pattern> Running Pint ./vendor/

Nopal 2 Aug 23, 2022
Mock built-in PHP functions (e.g. time(), exec() or rand())

PHP-Mock: mocking built-in PHP functions PHP-Mock is a testing library which mocks non deterministic built-in PHP functions like time() or rand(). Thi

null 331 Jan 3, 2023
A simple way to mock a client

Mocked Client A simple way to mock a client Install Via Composer $ composer require doppiogancio/mocked-client guzzlehttp/guzzle php-http/discovery No

Fabrizio Gargiulo 17 Oct 5, 2022
PHP Test Generator - A CLI tool which generates unit tests

This project make usages of PHPStan and PHPParser to generate test cases for a given PHP File.

Alexander Schranz 7 Dec 3, 2022
To run time/IO related unit tests (e.g., sleep function calls, database queries, API calls, etc) faster using Swoole.

To run time/IO related unit tests (e.g., sleep function calls, database queries, API calls, etc) faster using Swoole.

Demin Yin 11 Sep 9, 2022
Full-stack testing PHP framework

Codeception Modern PHP Testing for everyone Codeception is a modern full-stack testing framework for PHP. Inspired by BDD, it provides an absolutely n

Codeception Testing Framework 4.6k Jan 7, 2023
AST based PHP Mutation Testing Framework

Infection - Mutation Testing framework Please read documentation here: infection.github.io Twitter: @infection_php Discord: https://discord.gg/ZUmyHTJ

Infection - Mutation Testing Framework for PHP 1.8k Jan 2, 2023
Pest is an elegant PHP Testing Framework with a focus on simplicity

Pest is an elegant PHP Testing Framework with a focus on simplicity. It was carefully crafted to bring the joy of testing to PHP. Explore the docs: pe

PEST 5.9k Dec 27, 2022