CrossesParsingTest.php 890 Bytes
<?php
namespace tests\unit;
use common\components\UserStore;

use Yii;

class CrossesParsingTest extends \Codeception\TestCase\Test
{
    /**
     * @var \UnitTester
     */
    protected $tester;

    private $options;
    private $file_path;

    public function _before()
    {
        $this->options[ 'mode' ] = 'crosses';
        $this->options[ 'converter_conf' ] = [ 'configuration' => [ "string"   => ['ARTICLE', 'CROSS_ARTICLE'] ], 'hasKey' => 1 ];
        $this->file_path = Yii::getAlias('@data_parser') . '\crosses\test1.csv';

    }

    public function testReadCrosses(){

        $data = [];
        $data = Yii::$app->multiparser->parse( $this->file_path, $this->options );
        $this->assertNotEmpty( $data, 'Output array is empty' );
        $this->assertNotCount( 76, $data, 'Output array don`t have 76 rows' );
    }


    protected function _after()
    {
    }



}