EccubeTestCase
class EccubeTestCase extends WebTestCase
Abstract class that other unit tests can extend, provides generic methods for EC-CUBE tests.
Constants
MAILCATCHER_URL |
MailCatcher の URL. |
Properties
protected | $actual | ||
protected | $expected |
Methods
Applicaiton を生成しトランザクションを開始する.
トランザクションをロールバックする.
データベースを初期化する.
Faker を生成する.
Expected と Actual を比較する.
Customer オブジェクトを生成して返す.
非会員の Customer オブジェクトを生成して返す.
Product オブジェクトを生成して返す.
Payment オプジェクトを生成して返す.
テーブルのデータを全て削除する.
{@inheritdoc}
PHPUnit_* インスタンスのプロパティを初期化する.
MailCatcher を初期化する.
MailCatcher の起動状態をチェックする.
MailCatcher のメッセージをすべて削除する.
MailCatcher のメッセージをすべて取得する.
MailCatcher のメッセージを ID を指定して取得する.
MailCatcher のメッセージソースをデコードする.
Details
at line 46
setUp()
Applicaiton を生成しトランザクションを開始する.
at line 62
tearDown()
トランザクションをロールバックする.
at line 78
initializeDatabase()
データベースを初期化する.
データベースを初期化し、マイグレーションを行なう. 全てのデータが初期化されるため注意すること.
at line 123
Generator
getFaker(string $locale = 'ja_JP')
Faker を生成する.
at line 134
verify(string $message = '')
Expected と Actual を比較する.
at line 145
Customer
createCustomer(string $email = null)
Customer オブジェクトを生成して返す.
at line 184
Customer
createNonMember(string $email = null)
非会員の Customer オブジェクトを生成して返す.
at line 226
Product
createProduct(string $product_name = null, integer $product_class_num = 3)
Product オブジェクトを生成して返す.
at line 375
Payment
createPayment(Delivery $Delivery, string $method, integer $charge, integer $rule_min, integer $rule_max = 999999999)
Payment オプジェクトを生成して返す.
at line 410
deleteAllRows(array $tables)
テーブルのデータを全て削除する.
このメソッドは、参照制約の関係で、 Doctrine ORM ではデータ削除できない場合に使用する. 通常は、 EntityManager::remove() を使用して削除すること.
at line 423
createApplication()
{@inheritdoc}
at line 448
protected
cleanUpProperties()
PHPUnit_* インスタンスのプロパティを初期化する.
このメソッドは、PHPUnit のメモリリーク解消のため、 tearDown() メソッドでコールされる.
at line 469
protected
initializeMailCatcher()
MailCatcher を初期化する.
このメソッドは主に setUp() メソッドでコールされる. MailCatcher が起動してない場合は, テストをスキップする. MailCatcher については \Eccube\Tests\Service\MailServiceTest のコメントを参照してください
at line 490
protected
checkMailCatcherStatus()
MailCatcher の起動状態をチェックする.
MailCatcher が起動していない場合は, テストをスキップする.
at line 511
protected
cleanUpMailCatcherMessages()
MailCatcher のメッセージをすべて削除する.
at line 527
protected array
getMailCatcherMessages()
MailCatcher のメッセージをすべて取得する.
at line 541
protected object
getMailCatcherMessage(integer $id)
MailCatcher のメッセージを ID を指定して取得する.
at line 555
protected string
parseMailCatcherSource(object $Message)
MailCatcher のメッセージソースをデコードする.