2017 © Pedro Peláez
 

yii2-extension yii2-logstock

The testing extension for the Yii framework

image

pastuhov/yii2-logstock

The testing extension for the Yii framework

  • Friday, December 8, 2017
  • by pastuhov
  • Repository
  • 2 Watchers
  • 4 Stars
  • 769 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 5 Open issues
  • 16 Versions
  • 6 % Grown

The README.md

Snapshot testing extension for Yii 2

This extension provides recording and asserting application trace (snapshot). Based on yii\debug module., (*1)

Cover, (*2)

Support

  1. Unit
  2. Functional (without web server) - does not support
  3. Acceptance (throughout web server)

Latest Stable Version Build Status Total Downloads, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist pastuhov/yii2-logstock

or add, (*6)

"require-dev": {
    "pastuhov/yii2-logstock": "~1.0.0"
    ...

to the require section of your composer.json file., (*7)

Usage

Once the extension is installed, simply modify your application configuration as follows:, (*8)

...
if (YII_ENV_TEST) {
    // configuration adjustments for 'test' environment
    $config['bootstrap'][] = 'logstock';
    $config['modules']['logstock'] = [
        'class' => \pastuhov\logstock\Module::class,
    ];

}
...

Add pastuhov\logstock\UnitHelper to suit config, (*9)

modules:
    enabled:
        - pastuhov\logstock\UnitHelper

Use assertLog() method in tests, (*10)

...
    public function testExampleUnitUsage()
    {
        $this->tester->assertLog(function (){
            Yii::info('Test info message');
            Yii::$app->getDb()->createCommand('SELECT * FROM page')->execute();
        }, Yii::$app);
    }
...

First time snapshot artifact will be recorded, (*11)

1) Test example unit usage (unit\ExampleUnitTest::testExampleUnitUsage)
Fixture has aggregated. Please restart test!

Recorded snapshot:, (*12)

Entry: console

Test info message

SELECT * FROM page

On subsequent test runs Logstock will simply compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code that should be fixed, or the implementation has changed and the snapshot needs to be updated., (*13)

For more info see tests., (*14)

Testing

./vendor/bin/codecept run unit,acceptance

If web server needed:, (*15)

./tests/bin/yii serve&

Security

If you discover any security related issues, please email pastukhov_k@sima-land.ru instead of using the issue tracker., (*16)

The Versions

08/12 2017

dev-master

9999999-dev

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

08/12 2017

v3.1

3.1.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

25/09 2017

v3.0

3.0.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

06/03 2017

v1.20

1.20.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

06/03 2017

v2.0

2.0.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

17/02 2017

v1.10.0

1.10.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

04/02 2017

v1.9.0

1.9.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

03/02 2017

v1.8.0

1.8.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

02/02 2017

v1.7.0

1.7.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

02/02 2017

v1.6.0

1.6.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

01/02 2017

v1.5.0

1.5.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

01/02 2017

v1.4.0

1.4.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

31/01 2017

v1.3.0

1.3.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

31/01 2017

v1.2.0

1.2.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

30/01 2017

v1.1.0

1.1.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger

30/01 2017

v1.0.0

1.0.0.0

The testing extension for the Yii framework

  Sources   Download

MIT

The Requires

 

The Development Requires

debug testing yii2 debugger