Skip to content

true-async/amphp-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMPHP + TrueAsync Tests

A basic test suite demonstrating AMPHP library compatibility with TrueAsync PHP runtime.

Overview

This project contains a collection of basic tests that verify AMPHP's core features work with TrueAsync, including async/await patterns, concurrent execution, parallel processing, pipeline operations, and HTTP client functionality.

Features

The test suite covers:

  • Async/Await Operations - Basic async execution, concurrent task handling, nested async calls, error propagation
  • Parallel Processing - Concurrent task execution, task cancellation mechanisms
  • Pipeline Operations - Data streaming, pipeline transformations, error handling in pipelines
  • HTTP Client - Concurrent HTTP requests, response handling, error management

Requirements

Note: This code was tested on the TrueAsync PHP fiber-support branch

Installation

Clone the repository and install dependencies:

git clone https://github.com/true-async/amphp-tests.git
cd amphp-tests
composer install

Usage

Run all test suites:

php run_tests.php

Run individual test files:

php tests/test_async.php
php tests/test_parallel.php
php tests/test_pipeline.php
php tests/test_http.php

Test Structure

Test Runner (run_tests.php)

The main test runner executes all test suites and provides a summary of results with timing information.

Test Suites

  • tests/test_async.php - Async/await pattern tests
  • tests/test_parallel.php - Parallel processing tests
  • tests/test_pipeline.php - Pipeline and data streaming tests
  • tests/test_http.php - HTTP client functionality tests

Each test suite runs independently and reports individual test results.

Dependencies

  • amphp/amp ^3.0 - Core async primitives
  • amphp/parallel ^2.0 - Parallel processing utilities
  • amphp/http-client ^5.0 - HTTP client implementation

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

  • AMPHP - Asynchronous PHP framework
  • TrueAsync - True async runtime for PHP

About

AMPHP tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages