Eccube\Tests\Web\Admin\Product\CsvImportControllerTest::testCsvImportWithExistsProducts PHP Method

testCsvImportWithExistsProducts() public method

    public function testCsvImportWithExistsProducts()
    {
        $crawler = $this->scenario();
        $Products = $this->app['eccube.repository.product']->findAll();
        $this->expected = 12;
        $this->actual = count($Products);
        $this->verify();
        $new_count = 0;
        foreach ($Products as $Product) {
            $ProductClasses = $Product->getProductClasses();
            foreach ($ProductClasses as $ProductClass) {
                if (preg_match('/fork-0[0-9]-new/', $ProductClass->getCode())) {
                    $new_count++;
                }
            }
        }
        $this->expected = 3;
        $this->actual = $new_count;
        $this->verify('fork-0[0-9]-new に商品コードを変更したのは ' . $this->expected . '商品規格');
        $this->assertRegexp('/商品登録CSVファイルをアップロードしました。/u', $crawler->filter('div.alert-success')->text());
    }