class CsvImportServiceTest extends AbstractServiceTestCase

Copyright (C) 2012-2014 David de Boer david@ddeboer.nl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

CsvReaserTest より移植

Properties

protected $actual from EccubeTestCase
protected $expected from EccubeTestCase

Methods

setUp()

Applicaiton を生成しトランザクションを開始する.

tearDown()

トランザクションをロールバックする.

initializeDatabase()

データベースを初期化する.

Generator
getFaker(string $locale = 'ja_JP')

Faker を生成する.

verify(string $message = '')

Expected と Actual を比較する.

createCustomer(string $email = null)

Customer オブジェクトを生成して返す.

createProduct(string $product_name = null, integer $product_class_num = 3)

Product オブジェクトを生成して返す.

createOrder(Customer $Customer)

Order オブジェクトを生成して返す.

deleteAllRows(array $tables)

テーブルのデータを全て削除する.

createApplication()

{@inheritdoc}

cleanUpProperties()

PHPUnit_* インスタンスのプロパティを初期化する.

testCountWithoutHeaders()

No description

testCountWithHeaders()

No description

testLineBreaks()

No description

testDuplicateHeadersMerge()

No description

getReader($filename)

No description

Details

in EccubeTestCase at line 39
setUp()

Applicaiton を生成しトランザクションを開始する.

in EccubeTestCase at line 55
tearDown()

トランザクションをロールバックする.

in EccubeTestCase at line 71
initializeDatabase()

データベースを初期化する.

データベースを初期化し、マイグレーションを行なう. 全てのデータが初期化されるため注意すること.

in EccubeTestCase at line 116
Generator getFaker(string $locale = 'ja_JP')

Faker を生成する.

Parameters

string $locale ロケールを指定する. デフォルト ja_JP

Return Value

Generator

in EccubeTestCase at line 127
verify(string $message = '')

Expected と Actual を比較する.

Parameters

string $message エラーメッセージ

in EccubeTestCase at line 138
Customer createCustomer(string $email = null)

Customer オブジェクトを生成して返す.

Parameters

string $email メールアドレス. null の場合は, ランダムなメールアドレスが生成される.

Return Value

Customer

in EccubeTestCase at line 167
Product createProduct(string $product_name = null, integer $product_class_num = 3)

Product オブジェクトを生成して返す.

Parameters

string $product_name 商品名. null の場合はランダムな文字列が生成される.
integer $product_class_num 商品規格の生成数

Return Value

Product

in EccubeTestCase at line 244
Order createOrder(Customer $Customer)

Order オブジェクトを生成して返す.

Parameters

Customer $Customer Customer インスタンス

Return Value

Order

in EccubeTestCase at line 315
deleteAllRows(array $tables)

テーブルのデータを全て削除する.

このメソッドは、参照制約の関係で、 Doctrine ORM ではデータ削除できない場合に使用する. 通常は、 EntityManager::remove() を使用して削除すること.

Parameters

array $tables 削除対象のテーブル名の配列

in EccubeTestCase at line 328
createApplication()

{@inheritdoc}

in EccubeTestCase at line 353
protected cleanUpProperties()

PHPUnit_* インスタンスのプロパティを初期化する.

このメソッドは、PHPUnit のメモリリーク解消のため、 tearDown() メソッドでコールされる.

at line 34
testReadCsvFileWithColumnHeaders()

at line 63
testReadCsvFileWithoutColumnHeaders()

at line 71
testReadCsvFileWithManualColumnHeaders()

at line 84
testReadCsvFileWithTrailingBlankLines()

at line 97
testCountWithoutHeaders()

at line 104
testCountWithHeaders()

at line 112
testCountDoesNotMoveFilePointer()

at line 125
testLineBreaks()

at line 131
testDuplicateHeadersMerge()

at line 149
protected getReader($filename)

Parameters

$filename