class MemberRepositoryTest extends EccubeTestCase

MemberRepository test cases.

Constants

MAILCATCHER_URL

MailCatcher の URL.

Properties

protected $actual from EccubeTestCase
protected $expected from EccubeTestCase
protected $Member

Methods

setUp()

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

tearDown()

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

initializeDatabase()

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

Generator
getFaker(string $locale = 'ja_JP')

Faker を生成する.

verify(string $message = '')

Expected と Actual を比較する.

createMember($username = null)

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

createCustomer(string $email = null)

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

createCustomerAddress(Customer $Customer, boolean $is_nonmember = false)

CustomerAddress を生成して返す.

createNonMember(string $email = null)

非会員の Customer オブジェクトを生成して返す.

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

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

createOrder(Customer $Customer)

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

createPayment(Delivery $Delivery, string $method, integer $charge, integer $rule_min, integer $rule_max = 999999999)

Payment オプジェクトを生成して返す.

deleteAllRows(array $tables)

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

createApplication()

{@inheritdoc}

cleanUpProperties()

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

initializeMailCatcher()

MailCatcher を初期化する.

checkMailCatcherStatus()

MailCatcher の起動状態をチェックする.

cleanUpMailCatcherMessages()

MailCatcher のメッセージをすべて削除する.

array
getMailCatcherMessages()

MailCatcher のメッセージをすべて取得する.

object
getMailCatcherMessage(integer $id)

MailCatcher のメッセージを ID を指定して取得する.

string
parseMailCatcherSource(object $Message)

MailCatcher のメッセージソースをデコードする.

isSqliteInMemory()

in the case of sqlite in-memory database.

testLoadUserByUsername()

No description

testLoadUserByUsernameSetSameRecord()

loadUserByUsername内のgetNullOrSingleResultが正しい値を返却するかを確認する ※getNullOrSingleResultは「NonUniqueResultException」をスローするが >

同一IDのデーターを投入→取得した際にエラーがでないか確認を行う 投入データーは、同一レコード2件 2件のデータを投入しょうとしているが、本ケースでは、LoginIdがプライマリーキーのために > 重複データーは作成されない 重複データーが作成されなければ、getNullOrSingleResultは「NonUniqueResultException」を > スローしないため、重複データーが登録されない事、同一プライマリーをflushしてもエラーが > 発生しない事を確認 結果としては、一件のレコードをかえされる事を期待

testRefreshUser()

No description

testRefreshUserWithException()

No description

testSupportedClass()

No description

testUp()

No description

testUpWithException()

No description

testDown()

No description

testDownWithException()

No description

testSave()

No description

testSaveWithRankNull()

No description

testSaveWithException()

No description

testDelete()

No description

testDeleteWithException()

No description

testCreateSalt()

No description

testEncryptPassword()

No description

Details

at line 25
setUp()

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

in EccubeTestCase at line 48
tearDown()

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

in EccubeTestCase at line 68
initializeDatabase()

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

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

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

Faker を生成する.

Parameters

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

Return Value

Generator

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

Expected と Actual を比較する.

Parameters

string $message エラーメッセージ

in EccubeTestCase at line 156
Member createMember($username = null)

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

Parameters

$username

Return Value

Member

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

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

Parameters

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

Return Value

Customer

in EccubeTestCase at line 179
CustomerAddress createCustomerAddress(Customer $Customer, boolean $is_nonmember = false)

CustomerAddress を生成して返す.

Parameters

Customer $Customer 対象の Customer インスタンス
boolean $is_nonmember 非会員の場合 true

Return Value

CustomerAddress

in EccubeTestCase at line 190
Customer createNonMember(string $email = null)

非会員の Customer オブジェクトを生成して返す.

Parameters

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

Return Value

Customer

in EccubeTestCase at line 202
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 213
Order createOrder(Customer $Customer)

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

Parameters

Customer $Customer Customer インスタンス

Return Value

Order

in EccubeTestCase at line 231
Payment createPayment(Delivery $Delivery, string $method, integer $charge, integer $rule_min, integer $rule_max = 999999999)

Payment オプジェクトを生成して返す.

Parameters

Delivery $Delivery デフォルトで設定する配送オブジェクト
string $method 支払い方法名称
integer $charge 手数料
integer $rule_min 下限金額
integer $rule_max 上限金額

Return Value

Payment

in EccubeTestCase at line 244
deleteAllRows(array $tables)

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

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

Parameters

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

in EccubeTestCase at line 257
createApplication()

{@inheritdoc}

in EccubeTestCase at line 282
protected cleanUpProperties()

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

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

in EccubeTestCase at line 304
protected initializeMailCatcher()

MailCatcher を初期化する.

このメソッドは主に setUp() メソッドでコールされる. MailCatcher が起動してない場合は, テストをスキップする. MailCatcher については \Eccube\Tests\Service\MailServiceTest のコメントを参照してください

See also

\Eccube\Tests\Service\MailServiceTest

in EccubeTestCase at line 325
protected checkMailCatcherStatus()

MailCatcher の起動状態をチェックする.

MailCatcher が起動していない場合は, テストをスキップする.

in EccubeTestCase at line 346
protected cleanUpMailCatcherMessages()

MailCatcher のメッセージをすべて削除する.

in EccubeTestCase at line 362
protected array getMailCatcherMessages()

MailCatcher のメッセージをすべて取得する.

Return Value

array MailCatcher のメッセージの配列

in EccubeTestCase at line 376
protected object getMailCatcherMessage(integer $id)

MailCatcher のメッセージを ID を指定して取得する.

Parameters

integer $id メッセージの ID

Return Value

object MailCatcher のメッセージ

in EccubeTestCase at line 390
protected string parseMailCatcherSource(object $Message)

MailCatcher のメッセージソースをデコードする.

Parameters

object $Message MailCatcher のメッセージ

Return Value

string デコードされた eml 形式のソース

in EccubeTestCase at line 398
protected isSqliteInMemory()

in the case of sqlite in-memory database.

at line 47
testLoadUserByUsername()

at line 54
testLoadUserByUsernameWithException()

at line 80
testLoadUserByUsernameSetSameRecord()

loadUserByUsername内のgetNullOrSingleResultが正しい値を返却するかを確認する ※getNullOrSingleResultは「NonUniqueResultException」をスローするが >

同一IDのデーターを投入→取得した際にエラーがでないか確認を行う 投入データーは、同一レコード2件 2件のデータを投入しょうとしているが、本ケースでは、LoginIdがプライマリーキーのために > 重複データーは作成されない 重複データーが作成されなければ、getNullOrSingleResultは「NonUniqueResultException」を > スローしないため、重複データーが登録されない事、同一プライマリーをflushしてもエラーが > 発生しない事を確認 結果としては、一件のレコードをかえされる事を期待

at line 106
testRefreshUser()

at line 113
testRefreshUserWithException()

at line 125
testSupportedClass()

at line 130
testUp()

at line 141
testUpWithException()

at line 150
testDown()

at line 161
testDownWithException()

at line 170
testSave()

at line 184
testSaveWithRankNull()

at line 209
testSaveWithException()

at line 216
testDelete()

at line 226
testDeleteWithException()

at line 233
testCreateSalt()

at line 242
testEncryptPassword()