https://github.com/phpactor/test-utils
Test Utilities for Phpactor
https://github.com/phpactor/test-utils
Last synced: about 1 month ago
JSON representation
Test Utilities for Phpactor
- Host: GitHub
- URL: https://github.com/phpactor/test-utils
- Owner: phpactor
- License: mit
- Created: 2018-01-04T17:37:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-24T17:52:29.000Z (5 months ago)
- Last Synced: 2025-04-30T18:09:31.411Z (about 1 month ago)
- Language: PHP
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Test Utils
==========Set of general test utilties for Phpactor.
Workspace
---------The `Workspace` class is used to manage a test file workspace.
### Resetting / Creating a workspace
```php
$workspace = Workspace::create(__DIR__ . '/workspace');
$workspace->reset(); // creates or deletes then creates the workspace directory
```### Loading test files
Load a set of test files from a "manifest":
```php
$manifest = <<<'EOT'
// File: lib/ClassOne.php
loadManifest($manifest); // create the files in the manifestAssert::assertTrue($workspace->exists('lib/ClassOne.php'));
Assert::assertTrue($workspace->exists('lib/Foo/ClassTwo.php'));echo $workspace->getContents('/lib/Foo/ClassTwo.php');
```Contributing
------------This package is open source and welcomes contributions! Feel free to open a
pull request on this repository.Support
-------- Create an issue on the main [Phpactor](https://github.com/phpactor/phpactor) repository.
- Join the `#phpactor` channel on the Slack [Symfony Devs](https://symfony.com/slack-invite) channel.