Blame view

tests/unit/CrossesParsingTest.php 876 Bytes
51e6872d   Mihail   add custom test f...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  <?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'], ] ];
          $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()
      {
      }
  
  
  
  }