xml – -Translation – Keybot Dictionary

Spacer TTN Translation Network TTN TTN Login Deutsch Français Spacer Help
Source Languages Target Languages
Keybot 155 Results  phpunit.de
  PHPUnit Manual  
Composing a Test Suite Using XML Configuration
XML 設定ファイルを用いたテストスイートの構成
  PHPUnit Manual  
Test Results (XML)
テスト結果 (XML)
  PHPUnit Manual  
Code Coverage (XML)
コードカバレッジ (XML)
  PHPUnit Manual  
How to handle NULL with Flat XML / CSV Datasets?
フラット XML や CSV のデータセットで NULL を扱う方法は?
  PHPUnit Manual – Chapte...  
fixture1.xml
Composite データセット
  PHPUnit Manual – Chapte...  
user@desktop> phpunit --configuration developer-a.xml MyTests/
データベースの設定情報を切り替えてテストスイートを実行するには、 コマンドラインから次のようにします。
  PHPUnit Manual – Chapte...  
You can create a flat xml dataset instance from within your Database TestCase by calling the
結論として言えるのは、フラット XML データセットを使うなら NULL 値が不要な場合だけにしておいたほうがよい、ということだけです。
  PHPUnit Manual – Chapte...  
user@desktop> phpunit --configuration developer-b.xml MyTests/
user@desktop> phpunit --configuration developer-a.xml MyTests/
  PHPUnit Manual – Chapte...  
We then wrap the Flat XML DataSet into a Replacement DataSet:
Replacement データセットは既存のデータセットに対するデコレータで、 データセットの任意のカラムの値を別の値で置換することができます。 guestbook の例で NULL 値を扱うには、このようなファイルを作ります。
  PHPUnit Manual – Chapte...  
xml version="1.0" ?>
Composite データセットは、既存の複数のデータセットをひとつにまとめるときに有用です。 複数のデータセットに同名のテーブルが含まれる場合は、 指定した順で行を連結します。 たとえば、このようなふたつのデータセットがあるものとしましょう。 まずは
  PHPUnit Manual – Chapte...  
In conclusion I can only advise using the Flat XML datasets if you do not need NULL values.
一方、テーブルのカラムの一部だけをフラット XML データセットで指定すると、 それ以外のカラムにはデフォルト値が設定されます。 そのため、もし省略したカラムの定義が 「NOT NULL DEFAULT NULL」 などの場合はエラーになります。
  PHPUnit Manual – Chapte...  
Do not do this. Instead, you should use either the XML or the YAML DataSets.
そんな方法はありません。NULL が使いたければ XML あるいは YAML データセットを使わないといけません。
  PHPUnit Manual – Chapte...  
Specify the expected dataset in your preferred format (YAML, XML, ..)
ひとつあるいは複数のテーブルをデータベース内から指定する (実際のデータセット)。
  PHPUnit Manual – Chapte...  
xml version="1.0" ? >
フラット xml データセットでの NULL 値の処理は、あまりおもしろいものではありません。 ほとんどのデータベースでは、NULL 値と空文字列は別のものとして扱います (例外のひとつは Oracle です) が、これをフラット xml 形式で表すのは困難です。NULL 値を表すには、 行の指定のときに属性を省略します。 この例の掲示板で、匿名の投稿を許可し、そのときには user カラムに NULL を指定することにしましょう。 guestbook テーブルの状態は、このようになります。
  PHPUnit Manual – Chapte...  
that represents a data-set through an XML representation.
createFlatXMLDataSet($filename)
  PHPUnit Manual – Chapte...  
PHPUnit has another awesome feature that could make this testcase even more generic. If you use the XML Configuration you could make the database connection configurable per test-run. First let's create a “phpunit.xml” file in our tests/ directory of the application that looks like:
conn === null) { if (self::$pdo == null) { self::$pdo = new PDO('sqlite::memory:'); } $this->conn = $this->createDefaultDBConnection(self::$pdo, ':memory:'); } return $this->conn; } } ?>
  PHPUnit Manual – Chapte...  
The flat xml dataset makes a crucial assumption now, defining that the attributes on the first defined row of a table define the columns of this table. In the previous example this would mean “id”, “content”, “user” and “created” are columns of the guestbook table.
この例では、二番目のエントリが匿名の投稿を表します。 しかし、これはカラムの認識において深刻な問題につながります。 データセットが等しいことを確認するアサーションでは、各データセットでテーブルの持つカラムを指定しなければなりません。 ある属性がデータテーブルのすべての行で NULL だったなら、 Database Extension はそのカラムがテーブルに存在することをどうやって知るというのでしょう?
  PHPUnit Manual – Chapte...  
This abstraction is necessary to compare the actual contents of a database against the expected contents. Expectations can be represented as XML, YAML, CSV files or PHP array for example. The DataSet and DataTable interfaces enable the comparison of these conceptually different sources, emulating relational database storage in a semantically similar approach.
PHPUnit Database Extension の中心となる概念が データセットとデータテーブルです。まずはこの考え方を理解することが、 PHPUnit でのデータベースのテストをマスターする近道です。 データセットとデータテーブルは、データベースのテーブルや行、 そしてカラムの抽象化レイヤーです。シンプルな API によってデータベースの内容をオブジェクト構造に隠蔽できるだけでなく、 データベース以外のソースによる実装もできるようになっています。
  PHPUnit Manual – Chapte...  
phpunit.xml.dist
されていない
  PHPUnit Manual – Chapte...  
If you are using syntax that doesn't compile with a certain PHP Version look into the xml configuration for version dependent includes in the section called “Test Suites”
特定のバージョンの PHP でしか使えない構文を利用する場合は、 「テストスイート」 にあるように XML 設定ファイルでのバージョン依存のインクルードを検討しましょう。
  PHPUnit Manual – Append...  
XML Configuration, Composing a Test Suite Using XML Configuration
XML Configuration, XML 設定ファイルを用いたテストスイートの構成
  PHPUnit Manual – Append...  
XML Configuration, Composing a Test Suite Using XML Configuration
XML Configuration, XML 設定ファイルを用いたテストスイートの構成
  PHPUnit Manual – Chapte...  
xml configuration option. See the section called “Logging”. By default all files and their coverage status are shown in the detailed report. This can be changed via the
オプションでしか変更できません。 「ログ出力」 を参照ください。 デフォルトでは、すべてのファイルとそのカバレッジ情報が、詳細形式で表示されます。 この設定は、xml のオプション
  PHPUnit Manual – Chapte...  
Example 5.2: Composing a Test Suite Using XML Configuration
例 5.2: XML 設定ファイルを用いたテストスイートの構成
  PHPUnit Manual – Chapte...  
In turn, if you specify only a subset of the table columns in the Flat XML dataset all the omitted values are set to their default values. This will lead to errors if one of the omitted columns is defined as “NOT NULL DEFAULT NULL”.
フラット XML データセットを効率的に使うには、NULL 値がからむ場合は 各テーブルの最初の行には NULL を含まないようにします。 それ以降の行では、属性を省略して NULL を表すことができます。 これはあまりスマートなやり方ではありません。 というのも、データベースのアサーションで行の順番が影響してしまうからです。
  PHPUnit Manual – Chapte...  
php class ReplacementTest extends PHPUnit_Extensions_Database_TestCase { public function getDataSet() { $ds = $this->createFlatXmlDataSet('myFlatXmlFixture.xml'); $rds = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($ds); $rds->addFullReplacement('##NULL##', null); return $rds; } } ?
  PHPUnit Manual – Chapte...  
This is simple, convient AND it solves the NULL issue that the similar Flat XML dataset has. A NULL in YAML is just the column name without no value specified. An empty string is specified as
guestbook: - id: 1 content: "Hello buddy!" user: "joe" created: 2010-04-24 17:15:23 - id: 2 content: "I like it!" user: created: 2010-04-26 12:14:20
  PHPUnit Manual – Chapte...  
xml version="1.0" encoding="UTF-8" ? >
しかし、これはまだデータベースへの接続情報を PDO 接続の設定にハードコードしてしまっています。 PHPUnit にはさらにすばらしい機能があるので、それを使ってテストケースをより汎用的にしましょう。 XML 設定ファイル を使えば、テストの実行のたびにデータベース接続を設定できます。 まずは 「phpunit.xml」 というファイルをアプリケーションの tests/ ディレクトリに作り、 中身をこのようにします。
  PHPUnit Manual – Chapte...  
PHPUnit has another awesome feature that could make this testcase even more generic. If you use the XML Configuration you could make the database connection configurable per test-run. First let's create a “phpunit.xml” file in our tests/ directory of the application that looks like:
conn === null) { if (self::$pdo == null) { self::$pdo = new PDO('sqlite::memory:'); } $this->conn = $this->createDefaultDBConnection(self::$pdo, ':memory:'); } return $this->conn; } } ?>
  PHPUnit Manual – Append...  
F Time: 0 seconds, Memory: 5.00Mb There was 1 failure: 1) EqualsTest::testFailure Failed asserting that two DOM documents are equal. --- Expected +++ Actual @@ @@ xml version="1.0"? > - - - + + + /home/sb/EqualsTest.php:12 FAILURES!
PHPUnit 6.3.0 by Sebastian Bergmann and contributors. .F Time: 0 seconds, Memory: 5.75Mb There was 1 failure: 1) EqualsTest::testFailure Failed asserting that 1.1 matches expected 1.0. /home/sb/EqualsTest.php:11 FAILURES! Tests: 2, Assertions: 2, Failures: 1.
1 2 3 4 5 6 Arrow