Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

Commit

Permalink
[zh-cn] Sync with e3b6c80
Browse files Browse the repository at this point in the history
  • Loading branch information
Wynn Chen committed Jul 6, 2015
1 parent 2ebfe8d commit 2dbd6d1
Show file tree
Hide file tree
Showing 12 changed files with 342 additions and 59 deletions.
42 changes: 42 additions & 0 deletions src/4.4/zh_cn/assertions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ Tests: 1, Assertions: 1, Failures: 1.</screen>
</example>
</section>

<section id="appendixes.assertions.assertArraySubset">
<title>assertArraySubset()</title>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<para><literal>assertArraySubset(array $subset, array $array[, bool $strict = '', string $message = ''])</literal></para>
<para>当 <literal>$array</literal> 不包含 <literal>$subset</literal> 时报告错误,错误讯息由 <literal>$message</literal> 指定。</para>
<para><literal>$strict</literal> 是一个标志,用于表明是否需要对数组中的对象进行全等判定。</para>
<example id="appendixes.assertions.assertArraySubset.example">
<title>assertArraySubset() 的用法</title>
<programlisting><![CDATA[<?php
class ArraySubsetTest extends PHPUnit_Framework_TestCase
{
public function testFailure()
{
$this->assertArraySubset(['config' => ['key-a', 'key-b']], ['config' => ['key-a']]);
}
}
?>]]></programlisting>
<screen><userinput>phpunit ArrayHasKeyTest</userinput><![CDATA[
PHPUnit 4.4.0 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 5.00Mb
There was 1 failure:
1) Epilog\EpilogTest::testNoFollowOption
Failed asserting that an array has the subset Array &0 (
'config' => Array &1 (
0 => 'key-a'
1 => 'key-b'
)
).
/home/sb/ArraySubsetTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
</section>

<section id="appendixes.assertions.assertClassHasAttribute">
<title>assertClassHasAttribute()</title>
<indexterm><primary>assertClassHasAttribute()</primary></indexterm>
Expand Down
42 changes: 42 additions & 0 deletions src/4.5/zh_cn/assertions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ Tests: 1, Assertions: 1, Failures: 1.</screen>
</example>
</section>

<section id="appendixes.assertions.assertArraySubset">
<title>assertArraySubset()</title>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<para><literal>assertArraySubset(array $subset, array $array[, bool $strict = '', string $message = ''])</literal></para>
<para>当 <literal>$array</literal> 不包含 <literal>$subset</literal> 时报告错误,错误讯息由 <literal>$message</literal> 指定。</para>
<para><literal>$strict</literal> 是一个标志,用于表明是否需要对数组中的对象进行全等判定。</para>
<example id="appendixes.assertions.assertArraySubset.example">
<title>assertArraySubset() 的用法</title>
<programlisting><![CDATA[<?php
class ArraySubsetTest extends PHPUnit_Framework_TestCase
{
public function testFailure()
{
$this->assertArraySubset(['config' => ['key-a', 'key-b']], ['config' => ['key-a']]);
}
}
?>]]></programlisting>
<screen><userinput>phpunit ArrayHasKeyTest</userinput><![CDATA[
PHPUnit 4.4.0 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 5.00Mb
There was 1 failure:
1) Epilog\EpilogTest::testNoFollowOption
Failed asserting that an array has the subset Array &0 (
'config' => Array &1 (
0 => 'key-a'
1 => 'key-b'
)
).
/home/sb/ArraySubsetTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
</section>

<section id="appendixes.assertions.assertClassHasAttribute">
<title>assertClassHasAttribute()</title>
<indexterm><primary>assertClassHasAttribute()</primary></indexterm>
Expand Down
42 changes: 42 additions & 0 deletions src/4.6/zh_cn/assertions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ Tests: 1, Assertions: 1, Failures: 1.</screen>
</example>
</section>

<section id="appendixes.assertions.assertArraySubset">
<title>assertArraySubset()</title>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<para><literal>assertArraySubset(array $subset, array $array[, bool $strict = '', string $message = ''])</literal></para>
<para>当 <literal>$array</literal> 不包含 <literal>$subset</literal> 时报告错误,错误讯息由 <literal>$message</literal> 指定。</para>
<para><literal>$strict</literal> 是一个标志,用于表明是否需要对数组中的对象进行全等判定。</para>
<example id="appendixes.assertions.assertArraySubset.example">
<title>assertArraySubset() 的用法</title>
<programlisting><![CDATA[<?php
class ArraySubsetTest extends PHPUnit_Framework_TestCase
{
public function testFailure()
{
$this->assertArraySubset(['config' => ['key-a', 'key-b']], ['config' => ['key-a']]);
}
}
?>]]></programlisting>
<screen><userinput>phpunit ArrayHasKeyTest</userinput><![CDATA[
PHPUnit 4.4.0 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 5.00Mb
There was 1 failure:
1) Epilog\EpilogTest::testNoFollowOption
Failed asserting that an array has the subset Array &0 (
'config' => Array &1 (
0 => 'key-a'
1 => 'key-b'
)
).
/home/sb/ArraySubsetTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
</section>

<section id="appendixes.assertions.assertClassHasAttribute">
<title>assertClassHasAttribute()</title>
<indexterm><primary>assertClassHasAttribute()</primary></indexterm>
Expand Down
42 changes: 42 additions & 0 deletions src/4.7/zh_cn/assertions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ Tests: 1, Assertions: 1, Failures: 1.</screen>
</example>
</section>

<section id="appendixes.assertions.assertArraySubset">
<title>assertArraySubset()</title>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<para><literal>assertArraySubset(array $subset, array $array[, bool $strict = '', string $message = ''])</literal></para>
<para>当 <literal>$array</literal> 不包含 <literal>$subset</literal> 时报告错误,错误讯息由 <literal>$message</literal> 指定。</para>
<para><literal>$strict</literal> 是一个标志,用于表明是否需要对数组中的对象进行全等判定。</para>
<example id="appendixes.assertions.assertArraySubset.example">
<title>assertArraySubset() 的用法</title>
<programlisting><![CDATA[<?php
class ArraySubsetTest extends PHPUnit_Framework_TestCase
{
public function testFailure()
{
$this->assertArraySubset(['config' => ['key-a', 'key-b']], ['config' => ['key-a']]);
}
}
?>]]></programlisting>
<screen><userinput>phpunit ArrayHasKeyTest</userinput><![CDATA[
PHPUnit 4.4.0 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 5.00Mb
There was 1 failure:
1) Epilog\EpilogTest::testNoFollowOption
Failed asserting that an array has the subset Array &0 (
'config' => Array &1 (
0 => 'key-a'
1 => 'key-b'
)
).
/home/sb/ArraySubsetTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
</section>

<section id="appendixes.assertions.assertClassHasAttribute">
<title>assertClassHasAttribute()</title>
<indexterm><primary>assertClassHasAttribute()</primary></indexterm>
Expand Down
8 changes: 4 additions & 4 deletions src/4.7/zh_cn/installation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="installation.requirements">
<title>需求</title>

<para>PHPUnit 4.6 需要 PHP 5.3.3,强烈推荐使用最新版本的 PHP。</para>
<para>PHPUnit 4.7 需要 PHP 5.3.3,强烈推荐使用最新版本的 PHP。</para>

<para>PHPUnit 需要使用 <ulink url="http://php.net/manual/en/dom.setup.php">dom</ulink> 和 <ulink url="http://php.net/manual/en/json.installation.php">json</ulink> 扩展,它们通常是默认启用的。</para>

Expand Down Expand Up @@ -198,17 +198,17 @@ fi
<section id="installation.composer">
<title>Composer</title>

<para>如果用 <ulink url="https://getcomposer.org/">Composer</ulink> 来管理项目的依赖关系,只要在项目的 <literal>composer.json</literal> 文件中简单地加上对 <literal>phpunit/phpunit</literal> 的依赖关系即可。下面是一个最小化的 <literal>composer.json</literal> 文件的例子,只定义了一个对 PHPUnit 4.6 的开发时(development-time)依赖:</para>
<para>如果用 <ulink url="https://getcomposer.org/">Composer</ulink> 来管理项目的依赖关系,只要在项目的 <literal>composer.json</literal> 文件中简单地加上对 <literal>phpunit/phpunit</literal> 的依赖关系即可。下面是一个最小化的 <literal>composer.json</literal> 文件的例子,只定义了一个对 PHPUnit 4.7 的开发时(development-time)依赖:</para>

<programlisting><![CDATA[{
"require-dev": {
"phpunit/phpunit": "4.6.*"
"phpunit/phpunit": "4.7.*"
}
}]]></programlisting>

<para>要通过 Composer 完成系统级的安装,可以运行:</para>

<screen><userinput>composer global require &quot;phpunit/phpunit=4.6.*&quot;</userinput></screen>
<screen><userinput>composer global require &quot;phpunit/phpunit=4.7.*&quot;</userinput></screen>

<para>请确保 path 变量中包含有 <literal>~/.composer/vendor/bin/</literal>。</para>
</section>
Expand Down
42 changes: 42 additions & 0 deletions src/4.8/zh_cn/assertions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,48 @@ Failed asserting that class "stdClass" has attribute "foo".
/home/sb/ClassHasAttributeTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
</section>

<section id="appendixes.assertions.assertArraySubset">
<title>assertArraySubset()</title>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<indexterm><primary>assertArraySubset()</primary></indexterm>
<para><literal>assertArraySubset(array $subset, array $array[, bool $strict = '', string $message = ''])</literal></para>
<para>当 <literal>$array</literal> 不包含 <literal>$subset</literal> 时报告错误,错误讯息由 <literal>$message</literal> 指定。</para>
<para><literal>$strict</literal> 是一个标志,用于表明是否需要对数组中的对象进行全等判定。</para>
<example id="appendixes.assertions.assertArraySubset.example">
<title>assertArraySubset() 的用法</title>
<programlisting><![CDATA[<?php
class ArraySubsetTest extends PHPUnit_Framework_TestCase
{
public function testFailure()
{
$this->assertArraySubset(['config' => ['key-a', 'key-b']], ['config' => ['key-a']]);
}
}
?>]]></programlisting>
<screen><userinput>phpunit ArrayHasKeyTest</userinput><![CDATA[
PHPUnit 4.4.0 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 5.00Mb
There was 1 failure:
1) Epilog\EpilogTest::testNoFollowOption
Failed asserting that an array has the subset Array &0 (
'config' => Array &1 (
0 => 'key-a'
1 => 'key-b'
)
).
/home/sb/ArraySubsetTest.php:6
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.]]></screen>
</example>
Expand Down
8 changes: 4 additions & 4 deletions src/4.8/zh_cn/installation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="installation.requirements">
<title>需求</title>

<para>PHPUnit 4.6 需要 PHP 5.3.3,强烈推荐使用最新版本的 PHP。</para>
<para>PHPUnit 4.8 需要 PHP 5.3.3,强烈推荐使用最新版本的 PHP。</para>

<para>PHPUnit 需要使用 <ulink url="http://php.net/manual/en/dom.setup.php">dom</ulink> 和 <ulink url="http://php.net/manual/en/json.installation.php">json</ulink> 扩展,它们通常是默认启用的。</para>

Expand Down Expand Up @@ -198,17 +198,17 @@ fi
<section id="installation.composer">
<title>Composer</title>

<para>如果用 <ulink url="https://getcomposer.org/">Composer</ulink> 来管理项目的依赖关系,只要在项目的 <literal>composer.json</literal> 文件中简单地加上对 <literal>phpunit/phpunit</literal> 的依赖关系即可。下面是一个最小化的 <literal>composer.json</literal> 文件的例子,只定义了一个对 PHPUnit 4.6 的开发时(development-time)依赖:</para>
<para>如果用 <ulink url="https://getcomposer.org/">Composer</ulink> 来管理项目的依赖关系,只要在项目的 <literal>composer.json</literal> 文件中简单地加上对 <literal>phpunit/phpunit</literal> 的依赖关系即可。下面是一个最小化的 <literal>composer.json</literal> 文件的例子,只定义了一个对 PHPUnit 4.8 的开发时(development-time)依赖:</para>

<programlisting><![CDATA[{
"require-dev": {
"phpunit/phpunit": "4.6.*"
"phpunit/phpunit": "4.8.*"
}
}]]></programlisting>

<para>要通过 Composer 完成系统级的安装,可以运行:</para>

<screen><userinput>composer global require &quot;phpunit/phpunit=4.6.*&quot;</userinput></screen>
<screen><userinput>composer global require &quot;phpunit/phpunit=4.8.*&quot;</userinput></screen>

<para>请确保 path 变量中包含有 <literal>~/.composer/vendor/bin/</literal>。</para>
</section>
Expand Down
Loading

0 comments on commit 2dbd6d1

Please sign in to comment.