Last active
August 30, 2025 20:18
-
Star
(226)
You must be signed in to star a gist -
Fork
(64)
You must be signed in to fork a gist
-
-
Save loonies/1255249 to your computer and use it in GitHub Desktop.
Revisions
-
loonies revised this gist
Jul 5, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ Returns a matcher that matches when the method it is evaluated for is executed e ### exactly() Returns a matcher that matches when the method it is evaluated for is executed exactly $count times. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* -
loonies revised this gist
May 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Resources * [The UNIT in unit testing](https://edorian.github.io/2012-03-14-The-UNIT-in-unit-testing/) * [PHPUnit Cheat Sheet](http://otroblogmas.com/phpunit-cheat-sheet/) -
loonies revised this gist
Dec 19, 2013 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,20 @@ ## PHPUnit API reference - version 3.6 ## TODO Check those constraints: ~~~ $this->anything() $this->contains($value) $this->arrayHasKey($key) $this->equalTo($value, $delta, $maxDepth) $this->classHasAttribute($attribute) $this->greaterThan($value) $this->isInstanceOf($className) $this->isType($type) $this->matchesRegularExpression($pattern) $this->stringContains($string, $case) ~~~ -
Miodrag Tokić revised this gist
Jun 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ ## PHPUnit API reference - version 3.6 -
Miodrag Tokić revised this gist
Aug 20, 2012 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Returns a mock object for the specified class. *PHPUnit_Framework_MockObject_MockObject* **getMock**(*string* $originalClassName [, *mixed* $methods = array() [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE]]]]]]) ~~~ $this->getMock( $originalClassName, $methods = array(), @@ -21,7 +21,7 @@ $this->getMock( $callOriginalClone = TRUE, $callAutoload = TRUE ); ~~~ ### getMockForAbstractClass() @@ -32,7 +32,7 @@ Returns a mock object for the specified abstract class with all abstract methods *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**(*string* $originalClassName [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE [, *array* $mockedMethods = array()]]]]]]) ~~~ $this->getMockForAbstractClass( $originalClassName, array $arguments = array(), @@ -42,7 +42,7 @@ $this->getMockForAbstractClass( $callAutoload = TRUE, array $mockedMethods ); ~~~ ### getMockFromWsdl() @@ -53,15 +53,15 @@ Returns a mock object based on the given WSDL file. *PHPUnit_Framework_MockObject_MockObject* **getMockFromWsdl**(*string* $wsdlFile [, *string* $originalClassName [, *string* $mockClassName = '' [, *array* $mockedMethods = array() [, *bool* $callOriginalConstructor = TRUE]]]]) ~~~ $this->getMockFromWsdl( $wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = TRUE ); ~~~ ### getMockBuilder() @@ -72,7 +72,7 @@ Returns a builder object to create mock objects using a fluent interface. *PHPUnit_Framework_MockObject_MockBuilder* **getMockBuilder**(*string* **$className**) ~~~ $mock = $this->getMockBuilder($className) ->setMockClassName($name) ->setConstructorArgs(array()) @@ -90,4 +90,4 @@ $mock = $this->getMockBuilder($className) ->disableAutoload() ->setMethods(array()|NULL) ->getMockForAbstractClass(); ~~~ -
Miodrag Tokić revised this gist
Aug 20, 2012 . 8 changed files with 150 additions and 153 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ ## PHPUnit API - version 3.6 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,18 @@ # Assertions ## <a id="toc"></a>TOC * [String](#string) * [Array primitive](#array-primitive) * [Array class attribute](#array-class-attribute) * [Variable primitive](#variable-primitive) * [Variable class attribute](#variable-class-attribute) * [Class structure](#class-structure) * [File](#file) * [Xml](#Xml) * [Other](#other) ### <a id="string"></a>String * assertRegExp * assertNotRegExp @@ -21,7 +23,9 @@ $this->assertion() * assertStringEndsWith * assertStringEndsNotWith [TOC](#toc) ### <a id="array-primitive"></a>Array primitive * assertArrayHasKey * assertArrayNotHasKey @@ -34,7 +38,9 @@ $this->assertion() * assertSameSize * assertNotSameSize [TOC](#toc) ### <a id="array-class-attribute"></a>Array class attribute * assertAttributeContains * assertAttributeNotContains @@ -43,7 +49,9 @@ $this->assertion() * assertAttributeCount * assertAttributeNotCount [TOC](#toc) ### <a id="variable-primitive"></a>Variable primitive * assertTrue * assertFalse @@ -64,7 +72,9 @@ $this->assertion() * assertInternalType * assertNotInternalType [TOC](#toc) ### <a id="variable-class-attribute"></a>Variable class attribute * assertAttributeSame * assertAttributeNotSame @@ -80,8 +90,10 @@ $this->assertion() * assertAttributeNotInstanceOf * assertAttributeInternalType * assertAttributeNotInternalType [TOC](#toc) ### <a id="class-structure"></a>Class structure * assertClassHasAttribute * assertClassNotHasAttribute @@ -90,16 +102,20 @@ $this->assertion() * assertObjectHasAttribute * assertObjectNotHasAttribute [TOC](#toc) ### <a id="file"></a>File * assertFileEquals * assertFileNotEquals * assertStringEqualsFile * assertStringNotEqualsFile * assertFileExists * assertFileNotExists [TOC](#toc) ### <a id="xml"></a>Xml * assertXmlFileEqualsXmlFile * assertXmlFileNotEqualsXmlFile @@ -109,7 +125,9 @@ $this->assertion() * assertXmlStringNotEqualsXmlString * assertEqualXMLStructure [TOC](#toc) ### <a id="other"></a>Other * assertStringMatchesFormatFile * assertStringNotMatchesFormatFile @@ -118,4 +136,6 @@ $this->assertion() * assertSelectEquals * assertTag * assertNotTag * assertThat [TOC](#toc) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,93 @@ # Mocking ## TOC ### getMock() Returns a mock object for the specified class. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMock**(*string* $originalClassName [, *mixed* $methods = array() [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE]]]]]]) <code> $this->getMock( $originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE ); </code> ### getMockForAbstractClass() Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods to mock can be specified with the last parameter. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**(*string* $originalClassName [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE [, *array* $mockedMethods = array()]]]]]]) <code> $this->getMockForAbstractClass( $originalClassName, array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, array $mockedMethods ); </code> ### getMockFromWsdl() Returns a mock object based on the given WSDL file. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockFromWsdl**(*string* $wsdlFile [, *string* $originalClassName [, *string* $mockClassName = '' [, *array* $mockedMethods = array() [, *bool* $callOriginalConstructor = TRUE]]]]) <code> $this->getMockFromWsdl( $wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = TRUE ); </code> ### getMockBuilder() Returns a builder object to create mock objects using a fluent interface. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **getMockBuilder**(*string* **$className**) <code> $mock = $this->getMockBuilder($className) ->setMockClassName($name) ->setConstructorArgs(array()) ->disableOriginalConstructor() ->disableOriginalClone() ->disableAutoload() ->setMethods(array()|NULL) ->getMock(); $mock = $this->getMockBuilder($className) ->setMockClassName($name) ->setConstructorArgs(array()) ->disableOriginalConstructor() ->disableOriginalClone() ->disableAutoload() ->setMethods(array()|NULL) ->getMockForAbstractClass(); </code> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,48 +1,7 @@ # Setting up the expectations ## Matchers <code> $mock->expects($this->matcher()) </code> @@ -97,14 +56,22 @@ Returns a matcher that matches when the method it is evaluated for is invoked at *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* **at**(*int* **$index**) ## Constraints <code> $mock->with($this->constraint()) </code> ### equalTo() ### logicalAnd() ### logicalNot() ### logicalOr() ### logicalXor() ## Returns <code> $mock->will($this->return()) </code> ### returnValue() This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,78 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # Resources * [The UNIT in unit testing](http://edorian.posterous.com/the-unit-in-unit-testing) * [PHPUnit Cheat Sheet](http://otroblogmas.com/phpunit-cheat-sheet/) -
Miodrag Tokić revised this gist
May 11, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # Resources * [The UNIT in unit testing](http://edorian.posterous.com/the-unit-in-unit-testing) -
Miodrag Tokić revised this gist
Dec 10, 2011 . 3 changed files with 20 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,12 @@ ## Assertions Code: <code> $this->assertion() </code> ### String * assertRegExp This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ## Mockers Code: <code> $this->mocker() </code> @@ -41,6 +42,7 @@ Returns a builder object to create mock objects using a fluent interface. ## Matchers Code: <code> $mock->expects($this->matcher()) </code> @@ -100,6 +102,7 @@ Returns a matcher that matches when the method it is evaluated for is invoked at ## Stubs Code: <code> $mock->will($this->stub()) </code> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,14 @@ # PHPUnit_Framework_MockObject_MockBuilder ---- ## Mock builder Code: <code> $this->builder()->builder()... </code> ### setMethods() -
Miodrag Tokić revised this gist
Dec 10, 2011 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ ## Mockers Code: <code> $this->mocker() </code> ### getMock() @@ -41,9 +41,9 @@ Returns a builder object to create mock objects using a fluent interface. ## Matchers Code: <code> $mock->expects($this->matcher()) </code> ### any() @@ -100,9 +100,9 @@ Returns a matcher that matches when the method it is evaluated for is invoked at ## Stubs Code: <code> $mock->will($this->stub()) </code> ### returnValue() -
Miodrag Tokić revised this gist
Dec 10, 2011 . 6 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
Miodrag Tokić revised this gist
Dec 10, 2011 . 6 changed files with 337 additions and 146 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,115 @@ # PHPUnit_Framework_Assert ---- ## Assertions ### String * assertRegExp * assertNotRegExp * assertStringMatchesFormat * assertStringNotMatchesFormat * assertStringStartsWith * assertStringStartsNotWith * assertStringEndsWith * assertStringEndsNotWith ### Array primitive * assertArrayHasKey * assertArrayNotHasKey * assertContains * assertNotContains * assertContainsOnly * assertNotContainsOnly * assertCount * assertNotCount * assertSameSize * assertNotSameSize ### Array class attribute * assertAttributeContains * assertAttributeNotContains * assertAttributeContainsOnly * assertAttributeNotContainsOnly * assertAttributeCount * assertAttributeNotCount ### Variable primitive * assertTrue * assertFalse * assertNotNull * assertNull * assertSame * assertNotSame * assertEquals * assertNotEquals * assertEmpty * assertNotEmpty * assertGreaterThan * assertGreaterThanOrEqual * assertLessThan * assertLessThanOrEqual * assertInstanceOf * assertNotInstanceOf * assertInternalType * assertNotInternalType ### Variable class attribute * assertAttributeSame * assertAttributeNotSame * assertAttributeEquals * assertAttributeNotEquals * assertAttributeEmpty * assertAttributeNotEmpty * assertAttributeGreaterThan * assertAttributeGreaterThanOrEqual * assertAttributeLessThan * assertAttributeLessThanOrEqual * assertAttributeInstanceOf * assertAttributeNotInstanceOf * assertAttributeInternalType * assertAttributeNotInternalType ### Class structure * assertClassHasAttribute * assertClassNotHasAttribute * assertClassHasStaticAttribute * assertClassNotHasStaticAttribute * assertObjectHasAttribute * assertObjectNotHasAttribute ### File * assertFileEquals * assertFileNotEquals * assertStringEqualsFile * assertStringNotEqualsFile * assertFileExists * assertFileNotExists ### Xml * assertXmlFileEqualsXmlFile * assertXmlFileNotEqualsXmlFile * assertXmlStringEqualsXmlFile * assertXmlStringNotEqualsXmlFile * assertXmlStringEqualsXmlString * assertXmlStringNotEqualsXmlString * assertEqualXMLStructure ### Other * assertStringMatchesFormatFile * assertStringNotMatchesFormatFile * assertSelectCount * assertSelectRegExp * assertSelectEquals * assertTag * assertNotTag * assertThat This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # PHPUnit_Framework_MockObject_Matcher_Invocation ... This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ ## PHPUnit_Framework_MockObject_MockBuilder ### setMethods() Specify the methods that are to be replaced with a configurable test double. The behavior of the other methods is not changed. * **param**: *array|NULL* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setMethods**(*mixed* **$methods**) ### setConstructorArgs() Specifies the arguments for the constructor. * **param**: *array* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setConstructorArgs**(*array* **$args**) ### setMockClassName() Specifies the name for the mock class. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setMockClassName**(*string* **$name**) ### disableOriginalConstructor() Suppresses the invocation of the original constructor. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableOriginalConstructor**() ### disableOriginalClone() Suppresses the invocation of the original clone constructor. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableOriginalClone**() ### disableAutoload() Suppresses the use of class autoloading while creating the mock object. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableAutoload**() ### getMock() Creates a mock object using a fluent interface. * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMock**() ### getMockForAbstractClass() Creates a mock object for an abstract class using a fluent interface. * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**() This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # PHPUnit_Framework_MockObject_MockObject ### expects() This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,146 @@ # PHPUnit_Framework_TestCase ---- ## Mockers Code: ~~~ $this->mocker() ~~~ ### getMock() Returns a mock object for the specified class. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMock**(*string* $originalClassName [, *mixed* $methods = array() [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE]]]]]]) ### getMockForAbstractClass() Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods to mock can be specified with the last parameter. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**(*string* $originalClassName [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE [, *array* $mockedMethods = array()]]]]]]) ### getMockBuilder() Returns a builder object to create mock objects using a fluent interface. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **getMockBuilder**(*string* **$className**) ---- ## Matchers Code: ~~~ $mock->expects($this->matcher()) ~~~ ### any() Returns a matcher that matches when the method it is evaluated for is executed zero or more times. * **return**: *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* **any**() ### never() Returns a matcher that matches when the method it is evaluated for is never executed. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **never**() ### atLeastOnce() Returns a matcher that matches when the method it is evaluated for is executed at least once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* **atLeastOnce**() ### once() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **once**() ### exactly() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **exactly**(*int* **$count**) ### at() Returns a matcher that matches when the method it is evaluated for is invoked at the given $index. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* **at**(*int* **$index**) ---- ## Stubs Code: ~~~ $mock->will($this->stub()) ~~~ ### returnValue() Desc. *PHPUnit_Framework_MockObject_Stub_Return* **returnValue**(*mixed* $value) ### returnValueMap() Desc. *PHPUnit_Framework_MockObject_Stub_ReturnValue* **MapreturnValueMap**(*array* $valueMap) ### returnArgument() *PHPUnit_Framework_MockObject_Stub_ReturnArgument* **returnArgument**(*int* $argumentIndex) ### returnCallback() Desc. *PHPUnit_Framework_MockObject_Stub_ReturnCallback* **returnCallback**(*mixed* $callback) ### returnSelf() Returns the current object. *PHPUnit_Framework_MockObject_Stub_ReturnSelf* **returnSelf**() ### throwException() Desc. *PHPUnit_Framework_MockObject_Stub_Exception* **throwException**(*Exception* $exception) ### onConsecutiveCalls() Desc. *PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls* **onConsecutiveCalls**(*mixed* ... [, *mixed* ...]) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,147 +1,3 @@ ## PHPUnit API - version 3.6+ -
Miodrag Tokić revised this gist
Nov 28, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,7 +69,7 @@ Returns a builder object to create mock objects using a fluent interface. ### setMethods() Specify the methods that are to be replaced with a configurable test double. The behavior of the other methods is not changed. * **param**: *array* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* -
Miodrag Tokić revised this gist
Sep 30, 2011 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -135,3 +135,13 @@ Creates a mock object for an abstract class using a fluent interface. *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**() ## PHPUnit_Framework_MockObject_MockObject ### expects() ## PHPUnit_Framework_MockObject_Matcher_Invocation ... -
Miodrag Tokić revised this gist
Sep 30, 2011 . 1 changed file with 87 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ ## PHPUnit_Framework_TestCase ---- ### any() Returns a matcher that matches when the method it is evaluated for is executed zero or more times. @@ -48,4 +50,88 @@ Returns a matcher that matches when the method it is evaluated for is invoked at * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* **at**(*int* **$index**) ---- ### getMockBuilder() Returns a builder object to create mock objects using a fluent interface. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **getMockBuilder**(*string* **$className**) ## PHPUnit_Framework_MockObject_MockBuilder ### setMethods() Specifies the subset of methods to mock. Default is to mock all of them. * **param**: *array* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setMethods**(*array* **$methods**) ### setConstructorArgs() Specifies the arguments for the constructor. * **param**: *array* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setConstructorArgs**(*array* **$args**) ### setMockClassName() Specifies the name for the mock class. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **setMockClassName**(*string* **$name**) ### disableOriginalConstructor() Suppresses the invocation of the original constructor. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableOriginalConstructor**() ### disableOriginalClone() Suppresses the invocation of the original clone constructor. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableOriginalClone**() ### disableAutoload() Suppresses the use of class autoloading while creating the mock object. * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **disableAutoload**() ### getMock() Creates a mock object using a fluent interface. * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMock**() ### getMockForAbstractClass() Creates a mock object for an abstract class using a fluent interface. * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**() -
Miodrag Tokić revised this gist
Sep 30, 2011 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,38 +1,38 @@ ## PHPUnit_Framework_TestCase ### any() Returns a matcher that matches when the method it is evaluated for is executed zero or more times. * **return**: *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* **any**() ### never() Returns a matcher that matches when the method it is evaluated for is never executed. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **never**() ### atLeastOnce() Returns a matcher that matches when the method it is evaluated for is executed at least once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* **atLeastOnce**() ### once() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **once**() ### exactly() Returns a matcher that matches when the method it is evaluated for is executed exactly once. @@ -41,7 +41,7 @@ Returns a matcher that matches when the method it is evaluated for is executed e *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **exactly**(*int* **$count**) ### at() Returns a matcher that matches when the method it is evaluated for is invoked at the given $index. -
Miodrag Tokić created this gist
Sep 30, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ #### PHPUnit_Framework_TestCase ###### any() Returns a matcher that matches when the method it is evaluated for is executed zero or more times. * **return**: PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* **any**() ###### never() Returns a matcher that matches when the method it is evaluated for is never executed. * **return**: PHPUnit_Framework_MockObject_Matcher_InvokedCount *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **never**() ###### atLeastOnce() Returns a matcher that matches when the method it is evaluated for is executed at least once. * **return**: PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* **atLeastOnce**() ###### once() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **return**: PHPUnit_Framework_MockObject_Matcher_InvokedCount *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **once**() ###### exactly() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **exactly**(*int* **$count**) ###### at() Returns a matcher that matches when the method it is evaluated for is invoked at the given $index. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* **at**(*int* **$index**)