tests/unit/Handlers/OkFileHandlerTest.php
/**
     * Test the createOkFiles() method with a bunch of tow files.
     *
     * @return void
     */
Test the createOkFiles() method with a bunch of tow files.
@return void
Test the createOkFiles () method with a bunch of tow files . @return void
public function testCreateOkFilesWithBunch()
    {
        $pattern = __DIR__ . DIRECTORY_SEPARATOR . 'magento-import.*.csv';
        $okFileHandler = $this->getOkFileHandler(
            array(
                sprintf('%s/magento-import_20200326-145451.ok' , __DIR__) => array(
                    __DIR__ . DIRECTORY_SEPARATOR . 'magento-import_20200326-145451_01.csv',
                    __DIR__ . DIRECTORY_SEPARATOR . 'magento-import_20200326-145451_02.csv'
                )
            ),
            $pattern
        );
        $this->assertSame(1, $okFileHandler->createOkFiles($pattern));
    }
public function testCreateOkFilesWithBunch ( ) { $ pattern = __DIR__ . DIRECTORY_SEPARATOR . 'magento-import.*.csv' ; $ okFileHandler = $ this -> getOkFileHandler ( array ( sprintf ( '%s/magento-import_20200326-145451.ok' , __DIR__ ) => array ( __DIR__ . DIRECTORY_SEPARATOR . 'magento-import_20200326-145451_01.csv' , __DIR__ . DIRECTORY_SEPARATOR . 'magento-import_20200326-145451_02.csv' ) ) , $ pattern ) ; $ this -> assertSame ( 1 , $ okFileHandler -> createOkFiles ( $ pattern ) ) ; }
Test the createOkFiles() method with a bunch of tow files.
Test the createOkFiles () method with a bunch of tow files .
// initialize the pattern to use // load and initialize the .OK file handler we want to test // count the number of created .OK files