webforge / testplate
Testplate for webforge for base testcases
Installs: 2 303
Dependents: 19
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Requires
Requires (Dev)
- liip/rmt: 0.9.*
- pscheit/psc-cms: dev-master
- webforge/dom: *
- webforge/translation: dev-master
Suggests
- guzzle/guzzle: Needed for the GuzzleTester
- mockery/mockery: Better replacement for PHPUnits mock library
- webforge/dom: If you want to use the css() tests in your unit tests for html
README
Testplate for webforge for base testcases
installation
Use Composer to install.
composer require -v --prefer-source webforge/testplate:dev-master
to run the tests use:
phpunit
configuration
if you want to use the getFile()
or other file helpers you need to
$bootLoader->registerPackageRoot();
in your bootstrap.php. If you use registerCMSContainer
this is already done.
usage (css tester)
if you install webforge/dom
along testplate you can use fancy css tests (when you extend from Webforge\Code\Test\Base
).
In your class implement: Webforge\Code\Test\HTMLTesting
(base is already doing this, you only have to enable it)
$this->html = <<<'HTML' <div class="team"> <h1 class="active">team</h1> <div class="mitarbeiter"> imme </div> <div class="mitarbeiter"> philipp </div> </div> HTML; $this->css('div.team')->count(1) ->css('h1')->count(1)->hasClass('active')->end() ->css('div.mitarbeiter')->count(2)->end() ;
See here for a more detailed documentation