PHP Class Eccube\Tests\EccubeTestCase

Author: Kentaro Ohkouchi
Inheritance: extends Silex\WebTestCase
Afficher le fichier Open project: ec-cube/ec-cube Class Usage Examples

Protected Properties

Свойство Type Description
$actual
$expected

Méthodes publiques

Méthode Description
createApplication ( )
createCustomer ( string $email = null ) : Customer Customer オブジェクトを生成して返す.
createCustomerAddress ( Customer $Customer, boolean $is_nonmember = false ) : CustomerAddress CustomerAddress を生成して返す.
createMember ( string $username = null ) : Eccube\Entity\Member Member オブジェクトを生成して返す.
createNonMember ( string $email = null ) : Customer 非会員の Customer オブジェクトを生成して返す.
createOrder ( Customer $Customer ) : Order Order オブジェクトを生成して返す.
createPageLayout ( ) : Eccube\Entity\PageLayout PageLayout オブジェクトを生成して返す
createPayment ( Eccube\Entity\Delivery $Delivery, string $method, integer $charge, integer $rule_min, integer $rule_max = 999999999 ) : Eccube\Entity\Payment Payment オプジェクトを生成して返す.
createProduct ( string $product_name = null, integer $product_class_num = 3 ) : Product Product オブジェクトを生成して返す.
deleteAllRows ( array $tables ) テーブルのデータを全て削除する.
getFaker ( string $locale = 'ja_JP' ) : Faker\Factory\Generator Faker を生成する.
initializeDatabase ( ) データベースを初期化する.
setUp ( ) Applicaiton を生成しトランザクションを開始する.
tearDown ( ) トランザクションをロールバックする.
verify ( string $message = '' ) Expected と Actual を比較する.

Méthodes protégées

Méthode Description
checkMailCatcherStatus ( ) MailCatcher の起動状態をチェックする.
cleanUpMailCatcherMessages ( ) MailCatcher のメッセージをすべて削除する.
cleanUpProperties ( ) PHPUnit_* インスタンスのプロパティを初期化する.
getMailCatcherMessage ( integer $id ) : object MailCatcher のメッセージを ID を指定して取得する.
getMailCatcherMessages ( ) : array MailCatcher のメッセージをすべて取得する.
initializeMailCatcher ( ) MailCatcher を初期化する.
isSqliteInMemory ( ) in the case of sqlite in-memory database.
parseMailCatcherSource ( object $Message ) : string MailCatcher のメッセージソースをデコードする.

Method Details

checkMailCatcherStatus() protected méthode

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

cleanUpMailCatcherMessages() protected méthode

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

cleanUpProperties() protected méthode

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

createApplication() public méthode

public createApplication ( )

createCustomer() public méthode

Customer オブジェクトを生成して返す.
public createCustomer ( string $email = null ) : Customer
$email string メールアドレス. null の場合は, ランダムなメールアドレスが生成される.
Résultat Eccube\Entity\Customer

createCustomerAddress() public méthode

CustomerAddress を生成して返す.
public createCustomerAddress ( Customer $Customer, boolean $is_nonmember = false ) : CustomerAddress
$Customer Eccube\Entity\Customer 対象の Customer インスタンス
$is_nonmember boolean 非会員の場合 true
Résultat Eccube\Entity\CustomerAddress

createMember() public méthode

Member オブジェクトを生成して返す.
public createMember ( string $username = null ) : Eccube\Entity\Member
$username string . null の場合は, ランダムなユーザーIDが生成される.
Résultat Eccube\Entity\Member

createNonMember() public méthode

非会員の Customer オブジェクトを生成して返す.
public createNonMember ( string $email = null ) : Customer
$email string メールアドレス. null の場合は, ランダムなメールアドレスが生成される.
Résultat Eccube\Entity\Customer

createOrder() public méthode

Order オブジェクトを生成して返す.
public createOrder ( Customer $Customer ) : Order
$Customer Eccube\Entity\Customer Customer インスタンス
Résultat Eccube\Entity\Order

createPageLayout() public méthode

PageLayout オブジェクトを生成して返す
public createPageLayout ( ) : Eccube\Entity\PageLayout
Résultat Eccube\Entity\PageLayout

createPayment() public méthode

Payment オプジェクトを生成して返す.
public createPayment ( Eccube\Entity\Delivery $Delivery, string $method, integer $charge, integer $rule_min, integer $rule_max = 999999999 ) : Eccube\Entity\Payment
$Delivery Eccube\Entity\Delivery デフォルトで設定する配送オブジェクト
$method string 支払い方法名称
$charge integer 手数料
$rule_min integer 下限金額
$rule_max integer 上限金額
Résultat Eccube\Entity\Payment

createProduct() public méthode

Product オブジェクトを生成して返す.
public createProduct ( string $product_name = null, integer $product_class_num = 3 ) : Product
$product_name string 商品名. null の場合はランダムな文字列が生成される.
$product_class_num integer 商品規格の生成数
Résultat Eccube\Entity\Product

deleteAllRows() public méthode

このメソッドは、参照制約の関係で、 Doctrine ORM ではデータ削除できない場合に使用する. 通常は、 EntityManager::remove() を使用して削除すること.
public deleteAllRows ( array $tables )
$tables array 削除対象のテーブル名の配列

getFaker() public méthode

Faker を生成する.
public getFaker ( string $locale = 'ja_JP' ) : Faker\Factory\Generator
$locale string ロケールを指定する. デフォルト ja_JP
Résultat Faker\Factory\Generator

getMailCatcherMessage() protected méthode

MailCatcher のメッセージを ID を指定して取得する.
protected getMailCatcherMessage ( integer $id ) : object
$id integer メッセージの ID
Résultat object MailCatcher のメッセージ

getMailCatcherMessages() protected méthode

MailCatcher のメッセージをすべて取得する.
protected getMailCatcherMessages ( ) : array
Résultat array MailCatcher のメッセージの配列

initializeDatabase() public méthode

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

initializeMailCatcher() protected méthode

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

isSqliteInMemory() protected méthode

in the case of sqlite in-memory database.
protected isSqliteInMemory ( )

parseMailCatcherSource() protected méthode

MailCatcher のメッセージソースをデコードする.
protected parseMailCatcherSource ( object $Message ) : string
$Message object MailCatcher のメッセージ
Résultat string デコードされた eml 形式のソース

setUp() public méthode

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

tearDown() public méthode

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

verify() public méthode

Expected と Actual を比較する.
public verify ( string $message = '' )
$message string エラーメッセージ

Property Details

$actual protected_oe property

protected $actual

$expected protected_oe property

protected $expected