PHP code example of phpactor / test-utils
1. Go to this page and download the library: Download phpactor/test-utils library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpactor / test-utils example snippets
$workspace = Workspace::create(__DIR__ . '/workspace');
$workspace->reset(); // creates or deletes then creates the workspace directory
$manifest = <<<'EOT'
// File: lib/ClassOne.php
class ClassOne {}
// File: lib/Foo/ClassTwo.php
namespace Foo;
class ClassTwo {}
EOT
;
$workspace = Workspace::create(__DIR__ . '/workspace');
$workspace->loadManifest($manifest); // create the files in the manifest
Assert::assertTrue($workspace->exists('lib/ClassOne.php'));
Assert::assertTrue($workspace->exists('lib/Foo/ClassTwo.php'));
echo $workspace->getContents('/lib/Foo/ClassTwo.php');