All Projects → amphp → phpunit-util

amphp / phpunit-util

Licence: MIT license
Helper package to ease testing with PHPUnit.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to phpunit-util

asynit
🌠 Asynchronous HTTP Request Testing Library for API or more...
Stars: ✭ 74 (+311.11%)
Mutual labels:  phpunit, amphp
test-util
👓 Provides utilities for tests.
Stars: ✭ 15 (-16.67%)
Mutual labels:  phpunit, phpunit-util
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+1177.78%)
Mutual labels:  phpunit
ridge
Pure asynchronous PHP implementation of the AMQP 0-9-1 protocol.
Stars: ✭ 49 (+172.22%)
Mutual labels:  amphp
beanstalk
Asynchronous Beanstalk Client for PHP.
Stars: ✭ 62 (+244.44%)
Mutual labels:  amphp
PhpUnitAssertException
Assert exception/throwable/error PHPUnit trait
Stars: ✭ 18 (+0%)
Mutual labels:  phpunit
vscode-phpunit
The VS Code Test Explorer extension for PHPUnit
Stars: ✭ 100 (+455.56%)
Mutual labels:  phpunit
Steward
PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust
Stars: ✭ 215 (+1094.44%)
Mutual labels:  phpunit
phpunit-documentation-chinese
Simplified Chinese Documentation for PHPUnit
Stars: ✭ 35 (+94.44%)
Mutual labels:  phpunit
specter-php
JSON Mocking and Testing for PHP
Stars: ✭ 18 (+0%)
Mutual labels:  phpunit
wordpress-plugin
WordPress plugin starter template with all of the things.
Stars: ✭ 19 (+5.56%)
Mutual labels:  phpunit
intellij-drupal-run-tests
Provides a run configuration that executes Drupal's test runner (for Simpletest, Unit, Kernel, Functional, FunctionalJavascript.)
Stars: ✭ 24 (+33.33%)
Mutual labels:  phpunit
phpboilerplate
PHP boilerplate with composer psr-4, phpunit and travis-ci.
Stars: ✭ 15 (-16.67%)
Mutual labels:  phpunit
composer-plugin-qa
Comprehensive Plugin for composer to execute PHP Quality assurance Tools
Stars: ✭ 25 (+38.89%)
Mutual labels:  phpunit
Phpstan Phpunit
PHPUnit extensions and rules for PHPStan
Stars: ✭ 247 (+1272.22%)
Mutual labels:  phpunit
PHPUnit-Polyfills
Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
Stars: ✭ 147 (+716.67%)
Mutual labels:  phpunit
Bypass Finals
Removes final keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit or Mockery.
Stars: ✭ 228 (+1166.67%)
Mutual labels:  phpunit
gitamp
Listen to music generated by events across github.
Stars: ✭ 29 (+61.11%)
Mutual labels:  amphp
phpunit-detailed-printer
Detailed output formatter for PHPUnit tests
Stars: ✭ 39 (+116.67%)
Mutual labels:  phpunit
php-toolbox
🐳 A Docker image designed for PHP developers that care about code quality.
Stars: ✭ 18 (+0%)
Mutual labels:  phpunit

phpunit-util

License

amphp/phpunit-util is a small helper package to ease testing with PHPUnit in combination with the Amp concurrency framework.

Required PHP Version

  • PHP 7.1+

Installation

composer require --dev amphp/phpunit-util

Usage

<?php

namespace Foo;

use Amp\ByteStream;
use Amp\PHPUnit\AsyncTestCase;
use Amp\Socket;

class BarTest extends AsyncTestCase
{
    // Each test case is executed as a coroutine and checked to run to completion
    public function test()
    {
        $socket = yield Socket\connect('tcp://localhost:12345');
        yield $socket->write('foobar');

        $this->assertSame('foobar', yield ByteStream\buffer($socket));
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].