Permalink
Browse files

Final amends on using namespace instead of underscore in documentation

  • Loading branch information...
1 parent 5eee695 commit 900ef519ad29bc7b7dbf8b34acbc6ec0102223af @MarcelloDuarte MarcelloDuarte committed Apr 20, 2011
View
@@ -7,6 +7,7 @@ Lead Developers
Pádraic Brady
Travis Swicegood
+Marcello Duarte
Documentation
=============
View
@@ -247,7 +247,7 @@ Other Targets:
several issues, include one reporting bug
* Included Japanese translation of the manual courtesy
of TAKAGI Masahiro
- * Refactored Runner logic into PHPSpec_Runner class
+ * Refactored Runner logic into \PHPSpec\Runner class
* Added API Docs to documentation directory
* Cleaned up and documented Console and HTTP options in
a new manual chapter
@@ -101,9 +101,9 @@ $options->recursive = true;
$options->specdocs = true;
$options->reporter = 'html';
-PHPSpec_Runner::run($options);</programlisting>
+\PHPSpec\Runner::run($options);</programlisting>
- <para>The <classname>PHPSpec_Runner</classname> class is actually used
+ <para>The <classname>\PHPSpec\Runner</classname> class is actually used
internally by the default Console Runner so what we're doing here is
pretty simple. All we're really doing is duplicating the internal work the
Console Runner performs within a PHP file we can visit from a web
@@ -44,7 +44,7 @@
<para>Start by writing a simple example that expresses a small part of the
behaviour our new Bowling game should exhibit.</para>
- <programlisting role="php">class DescribeNewBowlingGame extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewBowlingGame extends \PHPSpec\Context
{
private $_bowling = null;
@@ -71,6 +71,6 @@
your system (*.bat refers to a Windows friendly version) from the
"scripts" directory to a location on your system PATH. This script must be
edited to provide the location of the PHP binary executable as well as the
- path to the PHPSpec_Console_Command classfile.</para>
+ path to the \PHPSpec\Console\Command classfile.</para>
</section>
</section>
@@ -84,7 +84,7 @@
by creating a new Context class contain the examples demonstrating these
behaviours.</para>
- <programlisting role="php">class DescribeNewFilesystemLogger extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewFilesystemLogger extends \PHPSpec\Context
{
public function itShouldCreateCreateNewLogFileIfNoneExists()
@@ -129,7 +129,7 @@ Finished in 0.0468921661377 seconds
<example>
<title>Specification for a New Filesystem Logger Context</title>
- <programlisting role="php">class DescribeNewFilesystemLogger extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewFilesystemLogger extends \PHPSpec\Context
{
public function itShouldCreateCreateNewLogFileIfNoneExists()
@@ -184,7 +184,7 @@ Finished in 0.0468921661377 seconds
<orderedlist>
<listitem>
- <para>All Specs are aggregated within a PHPSpec_Context subclass
+ <para>All Specs are aggregated within a \PHPSpec\Context subclass
based on the condition of the system being specified</para>
</listitem>
@@ -201,7 +201,7 @@ Finished in 0.0468921661377 seconds
</listitem>
<listitem>
- <para>A <classname>PHPSpec_Context::spec()</classname> method is
+ <para>A <classname>\PHPSpec\Context::spec()</classname> method is
utilised to prepare any object or scalar value for expectations via
the DSL.</para>
</listitem>
@@ -324,7 +324,7 @@ $this-&gt;spec($bowling)-&gt;shouldNot-&gt;beAnInstanceOf('Logger');</programlis
<title>The Actual Value Term</title>
<para>In a PHPSpec Example method block, the DSL is instantiated using a
- call to the <classname>PHPSpec_Context::spec()</classname>. This accepts
+ call to the <classname>\PHPSpec\Context::spec()</classname>. This accepts
three possible parameter groupings.</para>
<orderedlist>
@@ -397,7 +397,7 @@ $spec-&gt;(is_int('string'))-&gt;shouldNot-&gt;beTrue();</programlisting>
is a simple object which compares an Actual Value Term with the expected
value passed to the Matcher method in the DSL for a positive or negative
match. The form of a Matcher is ruled by the
- <classname>PHPSpec_Matcher_Interface</classname> interface so you can
+ <classname>\PHPSpec\Matcher</classname> interface so you can
write custom Matchers (pending feature).</para>
<para>An already expansive range of Matchers are provided by the PHPSpec
@@ -628,7 +628,7 @@ class Flea extends Insect {
}
-class DescribeFlea extends PHPSpec_Context {
+class DescribeFlea extends \PHPSpec\Context {
public function itShouldBeAnInsect()
{
@@ -124,10 +124,10 @@ $options-&gt;recursive = true;
$options-&gt;specdocs = true;
$options-&gt;reporter = 'html';
-PHPSpec_Runner::run($options);</programlisting>
+\PHPSpec\Runner::run($options);</programlisting>
<para>
- <classname>PHPSpec_Runner</classname> クラスは、
+ <classname>\PHPSpec\Runner</classname> クラスは、
実際にはデフォルトのコンソールランナーで内部的に使用されているものです。
つまりここで行っているのは非常に単純なことです。
この例で実際にやっていることは、
@@ -154,7 +154,7 @@ PHPSpec_Runner::run($options);</programlisting>
</para>
<para>
- 最後に、PHPSpec_Runner の static メソッド run() を実行します。
+ 最後に、\PHPSpec\Runner の static メソッド run() を実行します。
これで完了!
特定のサブディレクトリのスペックだけを実行したいのなら、
このファイルをそのサブディレクトリにコピーすればいいでしょう
@@ -55,7 +55,7 @@
このサンプルは、ボウリングゲームをはじめるにあたって守らなければならない決まりの一部を表すものです。
</para>
- <programlisting role="php">class DescribeNewBowlingGame extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewBowlingGame extends \PHPSpec\Context
{
private $_bowling = null;
@@ -86,7 +86,7 @@
また、"scripts" ディレクトリにあるスクリプト phpspec
(Windows の場合は phpspec.bat)
を、パスの通った場所にコピーします。必要に応じてこのスクリプトを編集し、
- PHP バイナリ実行ファイルの場所や PHPSpec_Console_Command
+ PHP バイナリ実行ファイルの場所や \PHPSpec\Console\Command
クラスファイルの場所を設定する必要があります。
</para>
</section>
@@ -114,7 +114,7 @@
その振る舞いを表すサンプルを定義します。
</para>
- <programlisting role="php">class DescribeNewFilesystemLogger extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewFilesystemLogger extends \PHPSpec\Context
{
public function itShouldCreateCreateNewLogFileIfNoneExists()
@@ -167,7 +167,7 @@ Finished in 0.0468921661377 seconds
<example>
<title>New Filesystem Logger コンテキストの仕様</title>
- <programlisting role="php">class DescribeNewFilesystemLogger extends PHPSpec_Context
+ <programlisting role="php">class DescribeNewFilesystemLogger extends \PHPSpec\Context
{
public function itShouldCreateCreateNewLogFileIfNoneExists()
@@ -228,7 +228,7 @@ Finished in 0.0468921661377 seconds
<orderedlist>
<listitem>
<para>
- すべてのスペックは PHPSpec_Context のサブクラスに記述し、
+ すべてのスペックは \PHPSpec\Context のサブクラスに記述し、
システムの仕様を表す条件をここに集約する
</para>
</listitem>
@@ -251,7 +251,7 @@ Finished in 0.0468921661377 seconds
<listitem>
<para>
- <classname>PHPSpec_Context::spec()</classname> メソッドを使用して、
+ <classname>\PHPSpec\Context::spec()</classname> メソッドを使用して、
DSL 経由で使用するオブジェクトやスカラー値を準備する
</para>
</listitem>
@@ -397,7 +397,7 @@ $this-&gt;spec($bowling)-&gt;shouldNot-&gt;beAnInstanceOf('Logger');</programlis
<para>
PHPSpec のサンプルメソッドで DSL のインスタンスを作成するには、
- <classname>PHPSpec_Context::spec()</classname> を使用します。
+ <classname>\PHPSpec\Context::spec()</classname> を使用します。
このメソッドには、次の 3 種類のパラメータを渡すことができます。
</para>
@@ -470,7 +470,7 @@ $spec-&gt;(is_int('string'))-&gt;shouldNot-&gt;beTrue();</programlisting>
PHPSpec は期待 (Expectation Term) と条件 (Matcher) に責任を分担させています。
Matcher はシンプルなオブジェクトで、実際の値と期待内容を
DSL のメソッドで比較します。そしてマッチしたか否かを返します。
- Matcher の形式は <classname>PHPSpec_Matcher_Interface</classname>
+ Matcher の形式は <classname>\PHPSpec\Matcher</classname>
インターフェイスで定義されているので、独自の Matchers
を書くこともできます (現在この機能は未完成です)。
</para>
@@ -736,7 +736,7 @@ class Flea extends Insect { // Flea ... ノミ
}
-class DescribeFlea extends PHPSpec_Context {
+class DescribeFlea extends \PHPSpec\Context {
public function itShouldBeAnInsect()
{
View
@@ -8,4 +8,4 @@
$options->specdoc = true;
$options->reporter = 'html';
-PHPSpec_Runner::run($options);
+\PHPSpec\Runner::run($options);
View
@@ -1,3 +0,0 @@
-<?php
-
-require_once 'PHPSpec/Framework.php';
@@ -14,7 +14,7 @@
*
* @category PHPSpec
* @package PHPSpec
- * @copyright Copyright (c) 2007 Pdraic Brady, Travis Swicegood
+ * @copyright Copyright (c) 2007 Pdraic Brady, Travis Swicegood
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3
*/
namespace PHPSpec\Console;
@@ -25,7 +25,7 @@
/**
* @category PHPSpec
* @package PHPSpec
- * @copyright Copyright (c) 2007 Pdraic Brady, Travis Swicegood
+ * @copyright Copyright (c) 2007 Pdraic Brady, Travis Swicegood
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3
*/
class Command
@@ -50,7 +50,7 @@ class Command
-a, --autospec Run all tests continually, every 10 seconds\r\n";
/**
- * @param PHPSpec_Console_Getopt $options
+ * @param \PHPSpec\Console\Getopt $options
*/
public function __construct(\PHPSpec\Console\Getopt $options = null)
{
@@ -95,7 +95,7 @@ public function setAutotest(\PHPSpec\Extensions\Autotest $autotest)
}
/**
- * @return PHPSpec_Runner
+ * @return \PHPSpec\Runner
*/
public function getRunner()
{
@@ -106,7 +106,7 @@ public function getRunner()
}
/**
- * @param PHPSpec_Runner $runner
+ * @param \PHPSpec\Runner $runner
*/
public function setRunner(\PHPSpec\Runner $runner)
{
@@ -20,7 +20,7 @@
namespace PHPSpec\Runner;
/**
- * @see PHPSpec_Exception
+ * @see \PHPSpec\Exception
*/
require_once 'PHPSpec/Exception.php';
@@ -58,7 +58,7 @@ public function getContextDescription()
public function getSpecificationBeingExecuted()
{
if (is_null($this->_specificationBeingExecuted)) {
- throw new \PHPSpec\Exception('cannot return a PHPSpec_Specification until the example is executed');
+ throw new \PHPSpec\Exception("cannot return a \\PHPSpec\\Specification until the example is executed");
}
return $this->_specificationBeingExecuted;
}
@@ -56,7 +56,7 @@ public function execute(Collection $collection)
$collection->execute($this);
}
- public function addFailure(PHPSpec_Runner_Example $example, $line)
+ public function addFailure(Example $example, $line)
{
$fail = new Example\Fail($example);
$fail->setLine($line);
@@ -106,7 +106,7 @@ public function addPass(Example $example)
* even re-performance.
*
* @todo Needs refactoring to remove these duplicate methods!
- * @param string $type The PHPSpec_Runner_Example type being declared
+ * @param string $type The \PHPSpec\Runner\Example type being declared
* @return array Array of all examples of this specific type
*/
public function getTypes($type)
@@ -36,7 +36,7 @@ class Specification
* An object representation of a expectation representing
* "should" or "should not" states
*
- * @var PHPSpec_Expectation
+ * @var \PHPSpec\Expectation
*/
protected $_expectation = null;
@@ -70,7 +70,7 @@ class Specification
* and actual match for the given Matcher's criteria (e.g
* equals, instanceof, greater then, etc.)
*
- * PHPSpec_Matcher_Interface
+ * \PHPSpec\Matcher\Interface
*/
protected $_matcher = null;
@@ -81,7 +81,7 @@ class Specification
* Accepts a variable number of parameters in the case of object
* values for the classname and any constructor arguments.
*
- * @return PHPSpec_Specification
+ * @return \PHPSpec\Specification
*/
public static function getSpec()
{
@@ -185,7 +185,7 @@ public function __call($method, $args)
* instance of self. So "$spec->be" equates to "$spec->be()".
*
* @param string $name The method name to call (without braces)
- * @return PHPSpec_Specification An instance of self
+ * @return \PHPSpec\Specification An instance of self
*/
public function __get($name)
{
@@ -212,7 +212,7 @@ public function __get($name)
* interpreted (whether a matcher boolean result counts as a pass
* or a fail).
*
- * @return PHPSpec_Expectation
+ * @return \PHPSpec\Expectation
*/
public function getExpectation()
{
@@ -329,7 +329,7 @@ public function getMatcherNegativeFailureMessage()
/**
* Set the overall class which manages the running of specs. The usual
- * default here is assumed to be PHPSpec_Runner_Base.
+ * default here is assumed to be \PHPSpec\Runner\Base.
*
* @param object A runner object
* @todo Do we not yet have a Runner interface to reference?
@@ -36,7 +36,7 @@ class Object extends Specification
* Interrogator object utilised to mediate between the DSL and an Object
* value being specified.
*
- * @var PHPSpec_Object_Interrogator
+ * @var \PHPSpec\Object\Interrogator
*/
protected $_interrogator = null;

0 comments on commit 900ef51

Please sign in to comment.