chornij / console
Console tools
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/chornij/console
Requires
- php: >=5.4.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: 4.7.*
This package is not auto-updated.
Last update: 2025-10-25 23:37:24 UTC
README
- Report component - allow colorize output in console (useful for testing)
Installation
The preferred way to install this component is through composer.
Either run
php composer.phar require chornij/console "0.1.*"
or add
"chornij/console": "0.1.8"
to the require section of your composer.json file.
USAGE
Using Report component in PHPUnit tests:
<?php class ReportTest extends \PHPUnit_Framework_TestCase { /** * @var Report Report object */ private $report; /** * @inheritdoc */ public function setUp() { $this->report = new Report(); echo $this->report->title('Testing some component'); } public function testComponent() { $this->report->write('Start testing', 'blue'); $obj = new Component(); $obj->attribute = 1234; $this->assertTrue($obj->isValidated()); $this->report->write($obj->result, 'green'); $this->report->write('XML result:', ['bold', 'magenta']); $this->report->writeXml($obj->xmlResult); } }