eb / screenpiece
Installs: 297 198
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- ext-gd: *
Requires (Dev)
- phpunit/phpunit: ~5
README
$googleScreen = new Screen( GDImg::fromPath(__DIR__.'/tests/data/googleSample.png'), ['Google logo' => new Piece([10, 10, 230, 100], [], 0)] ); $screenshot = GDImg::fromPath(__DIR__.'/tests/data/googleScreenshot.png'); var_dump($googleScreen->equal($screenshot)); var_dump($googleScreen->piecePresent('Google logo', $screenshot));
$screenshot = GDImg::fromPath(__DIR__.'/data/google1.png'); $logo = GDImg::fromPath(__DIR__.'/data/googleLogo.png'); $pos = Utils::search($screenshot, $logo)(); var_dump($pos);
example.php
docker-compose -f ./docker/docker-compose.yml run --rm php php app/example.php
тесты
docker-compose -f ./docker/docker-compose.yml run --rm php bash app/vendor/bin/phpunit -c app/tests/phpunit.xml app/tests