Permalink
Browse files

Move MockObject to Framework.

  • Loading branch information...
1 parent 9e701ed commit 62468a540f001cb20057444987943228abdf52e6 @sebastianbergmann committed Sep 29, 2006
Showing with 268 additions and 268 deletions.
  1. +6 −6 PHPUnit/Framework/Assert.php
  2. +2 −2 PHPUnit/{Extensions → Framework}/MockObject/Builder/Identity.php
  3. +11 −11 PHPUnit/{Extensions → Framework}/MockObject/Builder/InvocationMocker.php
  4. +3 −3 PHPUnit/{Extensions → Framework}/MockObject/Builder/Match.php
  5. +3 −3 PHPUnit/{Extensions → Framework}/MockObject/Builder/MethodNameMatch.php
  6. +6 −6 PHPUnit/{Extensions → Framework}/MockObject/Builder/Namespace.php
  7. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Builder/ParametersMatch.php
  8. +5 −5 PHPUnit/{Extensions → Framework}/MockObject/Builder/Stub.php
  9. +2 −2 PHPUnit/{Extensions → Framework}/MockObject/Invocation.php
  10. +15 −15 PHPUnit/{Extensions → Framework}/MockObject/InvocationMocker.php
  11. +7 −7 PHPUnit/{Extensions → Framework}/MockObject/Invokable.php
  12. +14 −14 PHPUnit/{Extensions → Framework}/MockObject/Matcher.php
  13. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Matcher/AnyParameters.php
  14. +7 −7 PHPUnit/{Extensions → Framework}/MockObject/Matcher/Invocation.php
  15. +5 −5 PHPUnit/{Extensions → Framework}/MockObject/Matcher/InvokedAtIndex.php
  16. +2 −2 PHPUnit/{Extensions → Framework}/MockObject/Matcher/InvokedAtLeastOnce.php
  17. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Matcher/InvokedCount.php
  18. +5 −5 PHPUnit/{Extensions → Framework}/MockObject/Matcher/InvokedRecorder.php
  19. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Matcher/MethodName.php
  20. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Matcher/Parameters.php
  21. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Matcher/StatelessInvocation.php
  22. +14 −14 PHPUnit/{Extensions → Framework}/MockObject/Mock.php
  23. +10 −10 PHPUnit/{Extensions → Framework}/MockObject/MockObject.php
  24. +6 −6 PHPUnit/{Extensions → Framework}/MockObject/Stub.php
  25. +5 −5 PHPUnit/{Extensions → Framework}/MockObject/Stub/ConsecutiveCalls.php
  26. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Stub/MatcherCollection.php
  27. +4 −4 PHPUnit/{Extensions → Framework}/MockObject/Stub/Return.php
  28. +1 −1 PHPUnit/{Extensions → Framework}/MockObject/Verifiable.php
  29. +15 −15 PHPUnit/Framework/TestCase.php
  30. +0 −2 PHPUnit/Tests/Extensions/AllTests.php
  31. +2 −0 PHPUnit/Tests/Framework/AllTests.php
  32. +3 −3 PHPUnit/Tests/{Extensions → Framework}/MockObjectTest.php
  33. +87 −87 package.xml
@@ -47,12 +47,12 @@
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Type.php';
-require_once 'PHPUnit/Extensions/MockObject/Mock.php';
-require_once 'PHPUnit/Extensions/MockObject/Matcher/InvokedAtLeastOnce.php';
-require_once 'PHPUnit/Extensions/MockObject/Matcher/InvokedAtIndex.php';
-require_once 'PHPUnit/Extensions/MockObject/Matcher/InvokedCount.php';
-require_once 'PHPUnit/Extensions/MockObject/Stub/ConsecutiveCalls.php';
-require_once 'PHPUnit/Extensions/MockObject/Stub/Return.php';
+require_once 'PHPUnit/Framework/MockObject/Mock.php';
+require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php';
+require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php';
+require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedCount.php';
+require_once 'PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php';
+require_once 'PHPUnit/Framework/MockObject/Stub/Return.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -55,7 +55,7 @@
* Defines the interface for recording unique identifiers. The identifiers
* can be used to define the invocation order of expectations. The expectation
* is recorded using id() and then defined in order using
- * PHPUnit_Extensions_MockObject_Builder_Match::after().
+ * PHPUnit_Framework_MockObject_Builder_Match::after().
*
* @category Testing
* @package PHPUnit
@@ -67,7 +67,7 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_Identity
+interface PHPUnit_Framework_MockObject_Builder_Identity
{
/**
* Sets the identification of the expectation to $id.
@@ -46,9 +46,9 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/MethodNameMatch.php';
-require_once 'PHPUnit/Extensions/MockObject/Matcher.php';
-require_once 'PHPUnit/Extensions/MockObject/Stub.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php';
+require_once 'PHPUnit/Framework/MockObject/Matcher.php';
+require_once 'PHPUnit/Framework/MockObject/Stub.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -58,7 +58,7 @@
* Provides methods for building expectations without having to resort to
* instantiating the various matchers manually. These methods also form a
* more natural way of reading the expectation. This class should be together
- * with the test case PHPUnit_Extensions_MockObject_TestCase.
+ * with the test case PHPUnit_Framework_MockObject_TestCase.
*
* @category Testing
* @package PHPUnit
@@ -70,16 +70,16 @@
* @link http://www.phpunit.de/
* @since Class available since Release 3.0.0
*/
-class PHPUnit_Extensions_MockObject_Builder_InvocationMocker implements PHPUnit_Extensions_MockObject_Builder_MethodNameMatch
+class PHPUnit_Framework_MockObject_Builder_InvocationMocker implements PHPUnit_Framework_MockObject_Builder_MethodNameMatch
{
private $collection;
private $matcher;
- public function __construct(PHPUnit_Extensions_MockObject_Stub_MatcherCollection $collection, PHPUnit_Extensions_MockObject_Matcher_Invocation $invocationMatcher)
+ public function __construct(PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection, PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher)
{
$this->collection = $collection;
- $this->matcher = new PHPUnit_Extensions_MockObject_Matcher($invocationMatcher);
+ $this->matcher = new PHPUnit_Framework_MockObject_Matcher($invocationMatcher);
$this->collection->addMatcher($this->matcher);
}
@@ -96,7 +96,7 @@ public function id($id)
return $this;
}
- public function will(PHPUnit_Extensions_MockObject_Stub $stub)
+ public function will(PHPUnit_Framework_MockObject_Stub $stub)
{
$this->matcher->stub = $stub;
@@ -122,7 +122,7 @@ public function with()
throw new RuntimeException('Parameter matcher is already defined, cannot redefine');
}
- $this->matcher->parametersMatcher = new PHPUnit_Extensions_MockObject_Matcher_Parameters($args);
+ $this->matcher->parametersMatcher = new PHPUnit_Framework_MockObject_Matcher_Parameters($args);
return $this;
}
@@ -137,7 +137,7 @@ public function withAnyParameters()
throw new RuntimeException('Parameter matcher is already defined, cannot redefine');
}
- $this->matcher->parametersMatcher = new PHPUnit_Extensions_MockObject_Matcher_AnyParameters();
+ $this->matcher->parametersMatcher = new PHPUnit_Framework_MockObject_Matcher_AnyParameters();
return $this;
}
@@ -148,7 +148,7 @@ public function method($constraint)
throw new RuntimeException('Method name matcher is already defined, cannot redefine');
}
- $this->matcher->methodNameMatcher = new PHPUnit_Extensions_MockObject_Matcher_MethodName($constraint);
+ $this->matcher->methodNameMatcher = new PHPUnit_Framework_MockObject_Matcher_MethodName($constraint);
return $this;
}
@@ -46,7 +46,7 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Stub.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Stub.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -63,14 +63,14 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_Match extends PHPUnit_Extensions_MockObject_Builder_Stub
+interface PHPUnit_Framework_MockObject_Builder_Match extends PHPUnit_Framework_MockObject_Builder_Stub
{
/**
* Defines the expectation which must occur before the current is valid.
*
* @param string $id The identification of the expectation that should
* occur before this one.
- * @return PHPUnit_Extensions_MockObject_Builder_Stub
+ * @return PHPUnit_Framework_MockObject_Builder_Stub
*/
public function after($id);
}
@@ -46,7 +46,7 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/ParametersMatch.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/ParametersMatch.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -63,7 +63,7 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_MethodNameMatch extends PHPUnit_Extensions_MockObject_Builder_ParametersMatch
+interface PHPUnit_Framework_MockObject_Builder_MethodNameMatch extends PHPUnit_Framework_MockObject_Builder_ParametersMatch
{
/**
* Adds a new method name match and returns the parameter match object for
@@ -72,7 +72,7 @@
* @param PHPUnit_Framework_Constraint $name Constraint for matching method, if a
* string is passed it will use the
* PHPUnit_Framework_Constraint_IsEqual.
- * @return PHPUnit_Extensions_MockObject_Builder_ParametersMatch
+ * @return PHPUnit_Framework_MockObject_Builder_ParametersMatch
*/
public function method($name);
}
@@ -46,14 +46,14 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Match.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Match.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
/**
* Interface for builders which can register builders with a given identification.
*
- * This interface relates to PHPUnit_Extensions_MockObject_Builder_Identity.
+ * This interface relates to PHPUnit_Framework_MockObject_Builder_Identity.
*
* @category Testing
* @package PHPUnit
@@ -65,13 +65,13 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_Namespace
+interface PHPUnit_Framework_MockObject_Builder_Namespace
{
/**
* Looks up the match builder with identification $id and returns it.
*
* @param string $id The identifiction of the match builder.
- * @return PHPUnit_Extensions_MockObject_Builder_Match
+ * @return PHPUnit_Framework_MockObject_Builder_Match
*/
public function lookupId($id);
@@ -81,8 +81,8 @@ public function lookupId($id);
* has been invoked.
*
* @param string $id The identification of the match builder.
- * @param PHPUnit_Extensions_MockObject_Builder_Match $builder The builder which is being registered.
+ * @param PHPUnit_Framework_MockObject_Builder_Match $builder The builder which is being registered.
*/
- public function registerId($id, PHPUnit_Extensions_MockObject_Builder_Match $builder);
+ public function registerId($id, PHPUnit_Framework_MockObject_Builder_Match $builder);
}
?>
@@ -46,7 +46,7 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Match.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Match.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -63,7 +63,7 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_ParametersMatch extends PHPUnit_Extensions_MockObject_Builder_Match
+interface PHPUnit_Framework_MockObject_Builder_ParametersMatch extends PHPUnit_Framework_MockObject_Builder_Match
{
/**
* Sets the parameters to match for, each parameter to this funtion will
@@ -80,7 +80,7 @@
* $b->with('smock', new PHPUnit_Framework_Constraint_IsEqual(42));
* </code>
*
- * @return PHPUnit_Extensions_MockObject_Builder_ParametersMatch
+ * @return PHPUnit_Framework_MockObject_Builder_ParametersMatch
*/
public function with();
@@ -93,7 +93,7 @@ public function with();
* $b->withAnyParamers();
* </code>
*
- * @return PHPUnit_Extensions_MockObject_Matcher_AnyParameters
+ * @return PHPUnit_Framework_MockObject_Matcher_AnyParameters
*/
public function withAnyParameters();
}
@@ -46,7 +46,7 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Identity.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Identity.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -63,15 +63,15 @@
* @link http://www.phpunit.de/
* @since Interface available since Release 3.0.0
*/
-interface PHPUnit_Extensions_MockObject_Builder_Stub extends PHPUnit_Extensions_MockObject_Builder_Identity
+interface PHPUnit_Framework_MockObject_Builder_Stub extends PHPUnit_Framework_MockObject_Builder_Identity
{
/**
* Stubs the matching method with the stub object $stub. Any invocations of
* the matched method will now be handled by the stub instead.
*
- * @param PHPUnit_Extensions_MockObject_Stub $stub The stub object.
- * @return PHPUnit_Extensions_MockObject_Builder_Identity
+ * @param PHPUnit_Framework_MockObject_Stub $stub The stub object.
+ * @return PHPUnit_Framework_MockObject_Builder_Identity
*/
- public function will(PHPUnit_Extensions_MockObject_Stub $stub);
+ public function will(PHPUnit_Framework_MockObject_Stub $stub);
}
?>
@@ -56,7 +56,7 @@
* The invocation consists of the object it occured from, the class name, the
* method name and all the parameters. The mock object must instantiate this
* class with the values from the mocked method and pass it to an object of
- * PHPUnit_Extensions_MockObject_Invokable.
+ * PHPUnit_Framework_MockObject_Invokable.
*
* @category Testing
* @package PHPUnit
@@ -68,7 +68,7 @@
* @link http://www.phpunit.de/
* @since Class available since Release 3.0.0
*/
-class PHPUnit_Extensions_MockObject_Invocation implements PHPUnit_Framework_SelfDescribing
+class PHPUnit_Framework_MockObject_Invocation implements PHPUnit_Framework_SelfDescribing
{
public $object;
@@ -46,19 +46,19 @@
*/
require_once 'PHPUnit/Util/Filter.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/InvocationMocker.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Match.php';
-require_once 'PHPUnit/Extensions/MockObject/Builder/Namespace.php';
-require_once 'PHPUnit/Extensions/MockObject/Matcher.php';
-require_once 'PHPUnit/Extensions/MockObject/Stub.php';
-require_once 'PHPUnit/Extensions/MockObject/Invocation.php';
-require_once 'PHPUnit/Extensions/MockObject/Invokable.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/InvocationMocker.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Match.php';
+require_once 'PHPUnit/Framework/MockObject/Builder/Namespace.php';
+require_once 'PHPUnit/Framework/MockObject/Matcher.php';
+require_once 'PHPUnit/Framework/MockObject/Stub.php';
+require_once 'PHPUnit/Framework/MockObject/Invocation.php';
+require_once 'PHPUnit/Framework/MockObject/Invokable.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
/**
* Mocker for invocations which are sent from
- * PHPUnit_Extensions_MockObject_MockObject objects.
+ * PHPUnit_Framework_MockObject_MockObject objects.
*
* Keeps track of all expectations and stubs as well as registering
* identifications for builders.
@@ -73,13 +73,13 @@
* @link http://www.phpunit.de/
* @since Class available since Release 3.0.0
*/
-class PHPUnit_Extensions_MockObject_InvocationMocker implements PHPUnit_Extensions_MockObject_Stub_MatcherCollection, PHPUnit_Extensions_MockObject_Invokable, PHPUnit_Extensions_MockObject_Builder_Namespace
+class PHPUnit_Framework_MockObject_InvocationMocker implements PHPUnit_Framework_MockObject_Stub_MatcherCollection, PHPUnit_Framework_MockObject_Invokable, PHPUnit_Framework_MockObject_Builder_Namespace
{
private $matchers = array();
private $builderMap = array();
- public function addMatcher(PHPUnit_Extensions_MockObject_Matcher_Invocation $matcher)
+ public function addMatcher(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
{
$this->matchers[] = $matcher;
}
@@ -93,7 +93,7 @@ public function lookupId($id)
return NULL;
}
- public function registerId($id, PHPUnit_Extensions_MockObject_Builder_Match $builder)
+ public function registerId($id, PHPUnit_Framework_MockObject_Builder_Match $builder)
{
if (isset($this->builderMap[$id])) {
throw new RuntimeException("Match builder with id <{$id}> is already registered.");
@@ -102,14 +102,14 @@ public function registerId($id, PHPUnit_Extensions_MockObject_Builder_Match $bui
$this->builderMap[$id] = $builder;
}
- public function expects(PHPUnit_Extensions_MockObject_Matcher_Invocation $matcher)
+ public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
{
- $builder = new PHPUnit_Extensions_MockObject_Builder_InvocationMocker($this, $matcher);
+ $builder = new PHPUnit_Framework_MockObject_Builder_InvocationMocker($this, $matcher);
return $builder;
}
- public function invoke(PHPUnit_Extensions_MockObject_Invocation $invocation)
+ public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation)
{
$hasReturnValue = FALSE;
$returnValue = NULL;
@@ -128,7 +128,7 @@ public function invoke(PHPUnit_Extensions_MockObject_Invocation $invocation)
return $returnValue;
}
- public function matches(PHPUnit_Extensions_MockObject_Invocation $invocation)
+ public function matches(PHPUnit_Framework_MockObject_Invocation $invocation)
{
foreach($this->matchers as $matcher) {
if (!$matcher->matches($invocation)) {
Oops, something went wrong.

0 comments on commit 62468a5

Please sign in to comment.