├── .gitignore ├── Main ├── css │ ├── main.css │ └── reset.css ├── footer.php ├── header.php ├── index.php ├── javascript │ ├── jquery.js │ └── main.js └── main.php ├── PHPUnit.php ├── PHPUnit ├── Extensions │ ├── Database │ │ ├── AbstractTester.php │ │ ├── Constraint │ │ │ ├── DataSetIsEqual.php │ │ │ └── TableIsEqual.php │ │ ├── DB │ │ │ ├── DataSet.php │ │ │ ├── DefaultDatabaseConnection.php │ │ │ ├── FilteredDataSet.php │ │ │ ├── IDatabaseConnection.php │ │ │ ├── IMetaData.php │ │ │ ├── MetaData.php │ │ │ ├── MetaData │ │ │ │ ├── InformationSchema.php │ │ │ │ ├── MySQL.php │ │ │ │ ├── Oci.php │ │ │ │ ├── PgSQL.php │ │ │ │ └── Sqlite.php │ │ │ ├── ResultSetTable.php │ │ │ ├── Table.php │ │ │ ├── TableIterator.php │ │ │ └── TableMetaData.php │ │ ├── DataSet │ │ │ ├── AbstractDataSet.php │ │ │ ├── AbstractTable.php │ │ │ ├── AbstractTableMetaData.php │ │ │ ├── AbstractXmlDataSet.php │ │ │ ├── CompositeDataSet.php │ │ │ ├── CsvDataSet.php │ │ │ ├── DataSetFilter.php │ │ │ ├── DefaultDataSet.php │ │ │ ├── DefaultTable.php │ │ │ ├── DefaultTableIterator.php │ │ │ ├── DefaultTableMetaData.php │ │ │ ├── FlatXmlDataSet.php │ │ │ ├── IDataSet.php │ │ │ ├── IPersistable.php │ │ │ ├── ISpec.php │ │ │ ├── ITable.php │ │ │ ├── ITableIterator.php │ │ │ ├── ITableMetaData.php │ │ │ ├── Persistors │ │ │ │ ├── Abstract.php │ │ │ │ ├── Factory.php │ │ │ │ ├── FlatXml.php │ │ │ │ ├── Xml.php │ │ │ │ └── Yaml.php │ │ │ ├── QueryDataSet.php │ │ │ ├── QueryTable.php │ │ │ ├── ReplacementDataSet.php │ │ │ ├── ReplacementTable.php │ │ │ ├── ReplacementTableIterator.php │ │ │ ├── Specs │ │ │ │ ├── Csv.php │ │ │ │ ├── DbQuery.php │ │ │ │ ├── DbTable.php │ │ │ │ ├── Factory.php │ │ │ │ ├── FlatXml.php │ │ │ │ ├── IFactory.php │ │ │ │ ├── Xml.php │ │ │ │ └── Yaml.php │ │ │ ├── TableFilter.php │ │ │ ├── TableMetaDataFilter.php │ │ │ ├── XmlDataSet.php │ │ │ └── YamlDataSet.php │ │ ├── DefaultTester.php │ │ ├── IDatabaseListConsumer.php │ │ ├── ITester.php │ │ ├── Operation │ │ │ ├── Composite.php │ │ │ ├── Delete.php │ │ │ ├── DeleteAll.php │ │ │ ├── Exception.php │ │ │ ├── Factory.php │ │ │ ├── IDatabaseOperation.php │ │ │ ├── Insert.php │ │ │ ├── Null.php │ │ │ ├── Replace.php │ │ │ ├── RowBased.php │ │ │ ├── Truncate.php │ │ │ └── Update.php │ │ ├── TestCase.php │ │ └── UI │ │ │ ├── Command.php │ │ │ ├── Context.php │ │ │ ├── IMedium.php │ │ │ ├── IMediumPrinter.php │ │ │ ├── IMode.php │ │ │ ├── IModeFactory.php │ │ │ ├── InvalidModeException.php │ │ │ ├── Mediums │ │ │ └── Text.php │ │ │ ├── ModeFactory.php │ │ │ └── Modes │ │ │ ├── ExportDataSet.php │ │ │ └── ExportDataSet │ │ │ └── Arguments.php │ ├── GroupTestSuite.php │ ├── OutputTestCase.php │ ├── PerformanceTestCase.php │ ├── PhptTestCase.php │ ├── PhptTestCase │ │ └── Logger.php │ ├── PhptTestSuite.php │ ├── RepeatedTest.php │ ├── SeleniumTestCase.php │ ├── SeleniumTestCase │ │ ├── Driver.php │ │ ├── append.php │ │ ├── phpunit_coverage.php │ │ └── prepend.php │ ├── Story │ │ ├── Given.php │ │ ├── ResultPrinter.php │ │ ├── ResultPrinter │ │ │ ├── HTML.php │ │ │ ├── Template │ │ │ │ ├── scenario.html.dist │ │ │ │ ├── scenario_header.html.dist │ │ │ │ ├── scenarios.html.dist │ │ │ │ └── step.html.dist │ │ │ └── Text.php │ │ ├── Scenario.php │ │ ├── SeleniumTestCase.php │ │ ├── Step.php │ │ ├── TestCase.php │ │ ├── Then.php │ │ └── When.php │ ├── TestDecorator.php │ ├── TicketListener.php │ └── TicketListener │ │ └── Trac.php ├── Framework.php ├── Framework │ ├── Assert.php │ ├── AssertionFailedError.php │ ├── ComparisonFailure.php │ ├── ComparisonFailure │ │ ├── Array.php │ │ ├── Object.php │ │ ├── Scalar.php │ │ ├── String.php │ │ └── Type.php │ ├── Constraint.php │ ├── Constraint │ │ ├── And.php │ │ ├── ArrayHasKey.php │ │ ├── Attribute.php │ │ ├── ClassHasAttribute.php │ │ ├── ClassHasStaticAttribute.php │ │ ├── FileExists.php │ │ ├── GreaterThan.php │ │ ├── IsAnything.php │ │ ├── IsEqual.php │ │ ├── IsFalse.php │ │ ├── IsIdentical.php │ │ ├── IsInstanceOf.php │ │ ├── IsNull.php │ │ ├── IsTrue.php │ │ ├── IsType.php │ │ ├── LessThan.php │ │ ├── Not.php │ │ ├── ObjectHasAttribute.php │ │ ├── Or.php │ │ ├── PCREMatch.php │ │ ├── StringContains.php │ │ ├── StringEndsWith.php │ │ ├── StringStartsWith.php │ │ ├── TraversableContains.php │ │ ├── TraversableContainsOnly.php │ │ └── Xor.php │ ├── Error.php │ ├── Error │ │ ├── Notice.php │ │ └── Warning.php │ ├── Exception.php │ ├── ExpectationFailedException.php │ ├── IncompleteTest.php │ ├── IncompleteTestError.php │ ├── MockObject │ │ ├── Builder │ │ │ ├── Identity.php │ │ │ ├── InvocationMocker.php │ │ │ ├── Match.php │ │ │ ├── MethodNameMatch.php │ │ │ ├── Namespace.php │ │ │ ├── ParametersMatch.php │ │ │ └── Stub.php │ │ ├── Generator.php │ │ ├── Generator │ │ │ ├── mocked_class.tpl.dist │ │ │ ├── mocked_clone.tpl.dist │ │ │ ├── mocked_method.tpl.dist │ │ │ ├── unmocked_clone.tpl.dist │ │ │ ├── wsdl_class.tpl.dist │ │ │ └── wsdl_method.tpl.dist │ │ ├── Invocation.php │ │ ├── InvocationMocker.php │ │ ├── Invokable.php │ │ ├── Matcher.php │ │ ├── Matcher │ │ │ ├── AnyInvokedCount.php │ │ │ ├── AnyParameters.php │ │ │ ├── Invocation.php │ │ │ ├── InvokedAtIndex.php │ │ │ ├── InvokedAtLeastOnce.php │ │ │ ├── InvokedCount.php │ │ │ ├── InvokedRecorder.php │ │ │ ├── MethodName.php │ │ │ ├── Parameters.php │ │ │ └── StatelessInvocation.php │ │ ├── MockObject.php │ │ ├── Stub.php │ │ ├── Stub │ │ │ ├── ConsecutiveCalls.php │ │ │ ├── Exception.php │ │ │ ├── MatcherCollection.php │ │ │ ├── Return.php │ │ │ ├── ReturnArgument.php │ │ │ └── ReturnCallback.php │ │ └── Verifiable.php │ ├── Process │ │ └── TestCaseMethod.tpl.dist │ ├── SelfDescribing.php │ ├── SkippedTest.php │ ├── SkippedTestError.php │ ├── SkippedTestSuiteError.php │ ├── Test.php │ ├── TestCase.php │ ├── TestFailure.php │ ├── TestListener.php │ ├── TestResult.php │ ├── TestSuite.php │ ├── TestSuite │ │ └── DataProvider.php │ └── Warning.php ├── Runner │ ├── BaseTestRunner.php │ ├── IncludePathTestCollector.php │ ├── StandardTestSuiteLoader.php │ ├── TestCollector.php │ ├── TestSuiteLoader.php │ └── Version.php ├── TextUI │ ├── Command.php │ ├── ResultPrinter.php │ └── TestRunner.php └── Util │ ├── Class.php │ ├── CodeCoverage.php │ ├── Configuration.php │ ├── Diff.php │ ├── ErrorHandler.php │ ├── File.php │ ├── Fileloader.php │ ├── Filesystem.php │ ├── Filter.php │ ├── FilterIterator.php │ ├── Getopt.php │ ├── GlobalState.php │ ├── InvalidArgumentHelper.php │ ├── Log │ ├── CPD.php │ ├── CodeCoverage │ │ ├── Database.php │ │ └── XML │ │ │ ├── Clover.php │ │ │ └── Source.php │ ├── Database.php │ ├── Database │ │ ├── MySQL.sql │ │ └── SQLite3.sql │ ├── GraphViz.php │ ├── JSON.php │ ├── JUnit.php │ ├── Metrics.php │ ├── PEAR.php │ ├── PMD.php │ ├── PMD │ │ ├── Rule.php │ │ └── Rule │ │ │ ├── Class.php │ │ │ ├── Class │ │ │ ├── DepthOfInheritanceTree.php │ │ │ ├── EfferentCoupling.php │ │ │ ├── ExcessiveClassLength.php │ │ │ ├── ExcessivePublicCount.php │ │ │ └── TooManyFields.php │ │ │ ├── File.php │ │ │ ├── Function.php │ │ │ ├── Function │ │ │ ├── CRAP.php │ │ │ ├── CodeCoverage.php │ │ │ ├── CyclomaticComplexity.php │ │ │ ├── ExcessiveMethodLength.php │ │ │ ├── ExcessiveParameterList.php │ │ │ └── NPathComplexity.php │ │ │ ├── Project.php │ │ │ └── Project │ │ │ └── CRAP.php │ └── TAP.php │ ├── Metrics.php │ ├── Metrics │ ├── Class.php │ ├── File.php │ ├── Function.php │ └── Project.php │ ├── PDO.php │ ├── PHP.php │ ├── Printer.php │ ├── Report.php │ ├── Report │ ├── Node.php │ ├── Node │ │ ├── Directory.php │ │ └── File.php │ └── Template │ │ ├── butter.png │ │ ├── chameleon.png │ │ ├── close12_1.gif │ │ ├── container-min.js │ │ ├── container.css │ │ ├── directory.html.dist │ │ ├── directory_item.html.dist │ │ ├── file.html.dist │ │ ├── file_item.html.dist │ │ ├── file_no_yui.html.dist │ │ ├── glass.png │ │ ├── method_item.html.dist │ │ ├── scarlet_red.png │ │ ├── snow.png │ │ ├── style.css │ │ ├── yahoo-dom-event.js │ │ └── yui_item.js │ ├── Skeleton.php │ ├── Skeleton │ ├── Class.php │ ├── Template │ │ ├── Class.tpl.dist │ │ ├── IncompleteTestMethod.tpl.dist │ │ ├── Method.tpl.dist │ │ ├── TestClass.tpl.dist │ │ ├── TestMethod.tpl.dist │ │ ├── TestMethodBool.tpl.dist │ │ ├── TestMethodBoolStatic.tpl.dist │ │ ├── TestMethodException.tpl.dist │ │ ├── TestMethodExceptionStatic.tpl.dist │ │ └── TestMethodStatic.tpl.dist │ └── Test.php │ ├── Template.php │ ├── Test.php │ ├── TestDox │ ├── NamePrettifier.php │ ├── ResultPrinter.php │ └── ResultPrinter │ │ ├── HTML.php │ │ └── Text.php │ ├── TestSuiteIterator.php │ ├── Timer.php │ ├── Type.php │ └── XML.php ├── Readme.md ├── Sandbox.php ├── assertionsPHPUnit.txt └── index.php /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /Main/css/reset.css: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------- 2 | 3 | Reset default browser CSS. 4 | 5 | Based on work by Eric Meyer: 6 | http://meyerweb.com/eric/tools/css/reset/index.html 7 | 8 | -------------------------------------------------------------- */ 9 | 10 | /* v1.0 | 20080212 */ 11 | 12 | html, body, div, span, applet, object, iframe, 13 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 14 | a, abbr, acronym, address, big, cite, code, 15 | del, dfn, em, font, img, ins, kbd, q, s, samp, 16 | small, strike, strong, sub, sup, tt, var, 17 | b, u, i, center, 18 | dl, dt, dd, ol, ul, li, 19 | fieldset, form, label, legend, 20 | table, caption, tbody, tfoot, thead, tr, th, td { 21 | margin: 0; 22 | padding: 0; 23 | border: 0; 24 | outline: 0; 25 | font-size: 100%; 26 | vertical-align: baseline; 27 | background: transparent; 28 | } 29 | body { 30 | line-height: 1; 31 | } 32 | ol, ul { 33 | list-style: none; 34 | } 35 | blockquote, q { 36 | quotes: none; 37 | } 38 | blockquote:before, blockquote:after, 39 | q:before, q:after { 40 | content: ''; 41 | content: none; 42 | } 43 | 44 | /* remember to define focus styles! */ 45 | :focus { 46 | outline: 0; 47 | } 48 | 49 | /* remember to highlight inserts somehow! */ 50 | ins { 51 | text-decoration: none; 52 | } 53 | del { 54 | text-decoration: line-through; 55 | } 56 | 57 | /* tables still need 'cellspacing="0"' in the markup */ 58 | table { 59 | border-collapse: collapse; 60 | border-spacing: 0; 61 | } 62 | 63 | a img { border: none; } 64 | -------------------------------------------------------------------------------- /Main/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Main/header.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Unit Test Report 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /Main/index.php: -------------------------------------------------------------------------------- 1 | compile('main.tpl'); 16 | require_once '../Sandbox.php'; 17 | include '../PHPUnit.php'; 18 | 19 | 20 | if(isset($_GET['path']) && is_dir($_GET['path'])) { 21 | $suite = (isset($_GET['test'])) ? $_GET['test'] : ''; 22 | 23 | $phpunit = new PHPUnit($_GET['path'], $suite); 24 | 25 | chdir($_GET['path']); 26 | } else { 27 | throw new Exception("Could not find the specified tests directory: ".$_GET['path'].'', 1); 28 | } 29 | 30 | $results = $phpunit->run(); 31 | // print_r($results); 32 | echo $phpunit->toHTML($results); 33 | 34 | include('footer.php'); 35 | 36 | 37 | // include('main.php'); 38 | } 39 | 40 | ?> -------------------------------------------------------------------------------- /Main/javascript/main.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $('.expand.button').each(function(index) { 4 | $(this).click(function(e) { 5 | 6 | if($(this).text() == '-') { 7 | if($(this).parent().hasClass('test')) { 8 | $(this).next('.more').slideUp(); 9 | } else { 10 | $(this).parent().next('.more').slideUp(); 11 | } 12 | $(this).text('+'); 13 | } else { 14 | if($(this).parent().hasClass('test')) { 15 | $(this).next('.more').slideDown(); 16 | } else { 17 | $(this).parent().next('.more').slideDown(); 18 | } 19 | $(this).text('-'); 20 | } 21 | }); 22 | }); 23 | 24 | 25 | 26 | // function run() { 27 | // $.ajax({ 28 | // url: '../PHPUnit.php', 29 | // 30 | // complete: function() { 31 | // //called when complete 32 | // }, 33 | // 34 | // success: function(response) { 35 | // var obj = jsonParse(response); 36 | // console.log(obj); 37 | // var object = eval(response); 38 | // console.log(object[0].event); 39 | // // alert(obj); 40 | // console.log(response); 41 | // 42 | // }, 43 | // 44 | // error: function() { 45 | // //called when there is an error 46 | // } 47 | // }); 48 | // } 49 | }); 50 | -------------------------------------------------------------------------------- /Main/main.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Main 8 | 9 | 10 | 11 | 12 |
13 | 14 |
15 |
16 |
17 |
TagTestCase
18 |
useful stats
19 |
-
20 |
21 |
22 |
23 |
24 |
25 |
test_one
26 |
useful stats
27 |
+
28 |
29 |
30 | Variables 31 |
32 |
33 | Stack Trace 34 |
35 |
36 |
37 |
38 |
39 |
40 |
test_two
41 |
useful stats
42 |
-
43 |
44 |
45 |
46 |
47 |
test_three
48 |
useful stats
49 |
+
50 |
51 |
52 |
53 |
54 |
55 |
56 |
TagTestCase
57 |
useful stats
58 |
-
59 |
60 |
61 |
62 |
63 |
64 |
test_one
65 |
useful stats
66 |
+
67 |
68 |
69 | Variables 70 |
71 |
72 | Stack Trace 73 |
74 |
75 |
76 |
77 |
78 |
79 |
test_two
80 |
useful stats
81 |
-
82 |
83 |
84 |
85 |
86 |
test_three
87 |
useful stats
88 |
+
89 |
90 |
91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DB/TableMetaData.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | require_once 'PHPUnit/Extensions/Database/DataSet/DefaultTableMetaData.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * This class loads a table metadata object with database metadata. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Mike Lively 58 | * @copyright 2010 Mike Lively 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.2.0 63 | */ 64 | class PHPUnit_Extensions_Database_DB_TableMetaData extends PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData 65 | { 66 | 67 | public function __construct($tableName, PHPUnit_Extensions_Database_DB_IMetaData $databaseMetaData) 68 | { 69 | $this->tableName = $tableName; 70 | $this->columns = $databaseMetaData->getTableColumns($tableName); 71 | $this->primaryKeys = $databaseMetaData->getTablePrimaryKeys($tableName); 72 | } 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/IPersistable.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | require_once 'PHPUnit/Extensions/Database/DataSet/IDataSet.php'; 50 | 51 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 52 | 53 | /** 54 | * An interface for persisting datasets 55 | * 56 | * @category Testing 57 | * @package PHPUnit 58 | * @author Mike Lively 59 | * @copyright 2010 Mike Lively 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.3.0 64 | */ 65 | interface PHPUnit_Extensions_Database_DataSet_IPersistable 66 | { 67 | /** 68 | * Writes the given dataset 69 | * 70 | * The previous dataset will be overwritten. 71 | * 72 | * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataset 73 | */ 74 | public function write(PHPUnit_Extensions_Database_DataSet_IDataSet $dataset); 75 | } 76 | ?> 77 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/ISpec.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0CSV 44 | */ 45 | 46 | /** 47 | * Provides an interface for creating data sets from data set spec strings. 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de//** 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_DataSet_ISpec 59 | { 60 | /** 61 | * Creates a data set from a data set spec string. 62 | * 63 | * @param string $dataSetSpec 64 | * @return PHPUnit_Extensions_Database_DataSet_IDataSet 65 | */ 66 | public function getDataSet($dataSetSpec); 67 | } 68 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/ITableIterator.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Provides a basic interface for creating and reading data from data sets. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Mike Lively 57 | * @copyright 2010 Mike Lively 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | interface PHPUnit_Extensions_Database_DataSet_ITableIterator extends Iterator 64 | { 65 | 66 | /** 67 | * Returns the current table. 68 | * 69 | * @return PHPUnit_Extensions_Database_DataSet_ITable 70 | */ 71 | public function getTable(); 72 | 73 | /** 74 | * Returns the current table's meta data. 75 | * 76 | * @return PHPUnit_Extensions_Database_DataSet_ITableMetaData 77 | */ 78 | public function getTableMetaData(); 79 | } 80 | ?> 81 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/Specs/FlatXml.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0CSV 44 | */ 45 | 46 | require_once ('PHPUnit/Extensions/Database/DataSet/ISpec.php'); 47 | require_once ('PHPUnit/Extensions/Database/DataSet/FlatXmlDataSet.php'); 48 | 49 | /** 50 | * Creates a FlatXML dataset based off of a spec string. 51 | * 52 | * The format of the spec string is as follows: 53 | * 54 | * 55 | * 56 | * The filename should be the location of a flat xml file relative to the 57 | * current working directory. 58 | * 59 | * @category Testing 60 | * @package PHPUnit 61 | * @author Mike Lively 62 | * @copyright 2010 Mike Lively 63 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 64 | * @version Release: 3.4.13 65 | * @link http://www.phpunit.de//** 66 | * @since Class available since Release 3.4.0 67 | */ 68 | class PHPUnit_Extensions_Database_DataSet_Specs_FlatXml implements PHPUnit_Extensions_Database_DataSet_ISpec 69 | { 70 | /** 71 | * Creates Flat XML Data Set from a data set spec. 72 | * 73 | * @param string $dataSetSpec 74 | * @return PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet 75 | */ 76 | public function getDataSet($dataSetSpec) 77 | { 78 | return new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($dataSetSpec); 79 | } 80 | } 81 | 82 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/Specs/IFactory.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | /** 47 | * An interface for data set spec factories. 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de//** 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_DataSet_Specs_IFactory 59 | { 60 | /** 61 | * Returns the data set 62 | * 63 | * @param string $type 64 | * @return PHPUnit_Extensions_Database_DataSet_ISpec 65 | */ 66 | public function getDataSetSpecByType($type); 67 | } 68 | 69 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/Specs/Xml.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0CSV 44 | */ 45 | 46 | require_once ('PHPUnit/Extensions/Database/DataSet/ISpec.php'); 47 | require_once ('PHPUnit/Extensions/Database/DataSet/XmlDataSet.php'); 48 | 49 | /** 50 | * Creates a XML dataset based off of a spec string. 51 | * 52 | * The format of the spec string is as follows: 53 | * 54 | * 55 | * 56 | * The filename should be the location of a xml file relative to the 57 | * current working directory. 58 | * 59 | * @category Testing 60 | * @package PHPUnit 61 | * @author Mike Lively 62 | * @copyright 2010 Mike Lively 63 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 64 | * @version Release: 3.4.13 65 | * @link http://www.phpunit.de//** 66 | * @since Class available since Release 3.4.0 67 | */ 68 | class PHPUnit_Extensions_Database_DataSet_Specs_Xml implements PHPUnit_Extensions_Database_DataSet_ISpec 69 | { 70 | /** 71 | * Creates XML Data Set from a data set spec. 72 | * 73 | * @param string $dataSetSpec 74 | * @return PHPUnit_Extensions_Database_DataSet_XmlDataSet 75 | */ 76 | public function getDataSet($dataSetSpec) 77 | { 78 | return new PHPUnit_Extensions_Database_DataSet_XmlDataSet($dataSetSpec); 79 | } 80 | } 81 | 82 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/DataSet/Specs/Yaml.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0CSV 44 | */ 45 | 46 | require_once ('PHPUnit/Extensions/Database/DataSet/ISpec.php'); 47 | require_once ('PHPUnit/Extensions/Database/DataSet/YamlDataSet.php'); 48 | 49 | /** 50 | * Creates a YAML dataset based off of a spec string. 51 | * 52 | * The format of the spec string is as follows: 53 | * 54 | * 55 | * 56 | * The filename should be the location of a yaml file relative to the 57 | * current working directory. 58 | * 59 | * @category Testing 60 | * @package PHPUnit 61 | * @author Mike Lively 62 | * @copyright 2010 Mike Lively 63 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 64 | * @version Release: 3.4.13 65 | * @link http://www.phpunit.de//** 66 | * @since Class available since Release 3.4.0 67 | */ 68 | class PHPUnit_Extensions_Database_DataSet_Specs_Yaml implements PHPUnit_Extensions_Database_DataSet_ISpec 69 | { 70 | /** 71 | * Creates YAML Data Set from a data set spec. 72 | * 73 | * @param string $dataSetSpec 74 | * @return PHPUnit_Extensions_Database_DataSet_YamlDataSet 75 | */ 76 | public function getDataSet($dataSetSpec) 77 | { 78 | return new PHPUnit_Extensions_Database_DataSet_YamlDataSet($dataSetSpec); 79 | } 80 | } 81 | 82 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/IDatabaseListConsumer.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | /** 47 | * An interface for classes that require a list of databases to operate. 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de/ 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_IDatabaseListConsumer 59 | { 60 | /** 61 | * Sets the database for the spec 62 | * 63 | * @param array $databases 64 | */ 65 | public function setDatabases(array $databases); 66 | } 67 | 68 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/Operation/IDatabaseOperation.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Provides a basic interface and functionality for executing database 53 | * operations against a connection using a specific dataSet. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Mike Lively 58 | * @copyright 2010 Mike Lively 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.2.0 63 | */ 64 | interface PHPUnit_Extensions_Database_Operation_IDatabaseOperation 65 | { 66 | 67 | /** 68 | * Executes the database operation against the given $connection for the 69 | * given $dataSet. 70 | * 71 | * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection 72 | * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet 73 | * @throws PHPUnit_Extensions_Database_Operation_Exception 74 | */ 75 | public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet); 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/Operation/Null.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | require_once 'PHPUnit/Extensions/Database/Operation/IDatabaseOperation.php'; 50 | 51 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 52 | 53 | /** 54 | * This class represents a null database operation. 55 | * 56 | * @category Testing 57 | * @package PHPUnit 58 | * @author Mike Lively 59 | * @copyright 2002-2010 Sebastian Bergmann 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.2.0 64 | */ 65 | class PHPUnit_Extensions_Database_Operation_Null implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation 66 | { 67 | 68 | public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) 69 | { 70 | /* do nothing */ 71 | } 72 | } 73 | ?> 74 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/UI/IMedium.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | require_once ('PHPUnit/Extensions/Database/UI/IMediumPrinter.php'); 47 | 48 | /** 49 | * Defines the interface necessary to create new mediums. 50 | * 51 | * @category Testing 52 | * @package PHPUnit 53 | * @author Mike Lively 54 | * @copyright 2010 Mike Lively 55 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 56 | * @version Release: 3.4.13 57 | * @link http://www.phpunit.de//** 58 | * @since Class available since Release 3.4.0 59 | */ 60 | interface PHPUnit_Extensions_Database_UI_IMedium extends PHPUnit_Extensions_Database_UI_IMediumPrinter 61 | { 62 | /** 63 | * Builds the context for the application. 64 | * 65 | * @param PHPUnit_Extensions_Database_UI_Context $context 66 | */ 67 | public function buildContext(PHPUnit_Extensions_Database_UI_Context $context); 68 | 69 | /** 70 | * Handles the displaying of exceptions received from the application. 71 | * 72 | * @param Exception $e 73 | */ 74 | public function handleException(Exception $e); 75 | } 76 | 77 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/UI/IMediumPrinter.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | /** 47 | * Defines the interface necessary to create new medium printers. 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de//** 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_UI_IMediumPrinter 59 | { 60 | /** 61 | * Prints standard output messages. 62 | * 63 | * @param string $message 64 | */ 65 | public function output($message); 66 | 67 | /** 68 | * Prints standard error messages. 69 | * 70 | * @param string $message 71 | */ 72 | public function error($message); 73 | } 74 | 75 | ?> -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/UI/IMode.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | /** 47 | * Defines the interface necessary to create new modes 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de//** 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_UI_IMode 59 | { 60 | /** 61 | * Executes the mode using the given arguments and medium. 62 | * 63 | * @param array $modeArguments 64 | * @param PHPUnit_Extensions_Database_UI_IMediumPrinter $medium 65 | */ 66 | public function execute(array $modeArguments, PHPUnit_Extensions_Database_UI_IMediumPrinter $medium); 67 | } 68 | 69 | ?> 70 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Database/UI/IModeFactory.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mike Lively 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | /** 47 | * Defines the interface necessary to create new mode factories 48 | * 49 | * @category Testing 50 | * @package PHPUnit 51 | * @author Mike Lively 52 | * @copyright 2010 Mike Lively 53 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 54 | * @version Release: 3.4.13 55 | * @link http://www.phpunit.de//** 56 | * @since Class available since Release 3.4.0 57 | */ 58 | interface PHPUnit_Extensions_Database_UI_IModeFactory 59 | { 60 | /** 61 | * Generates a new mode based on a given name. 62 | * 63 | * @param string $mode 64 | * @return PHPUnit_Extensions_Database_UI_IMode 65 | */ 66 | public function getMode($mode); 67 | 68 | /** 69 | * Returns the names of valid modes this factory can create. 70 | * 71 | * @return array 72 | */ 73 | public function getModeList(); 74 | } 75 | 76 | ?> 77 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/PhptTestCase/Logger.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.1.4 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Dummy logger for PEAR_RunTest. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Class available since Release 3.1.4 61 | */ 62 | class PHPUnit_Extensions_PhptTestCase_Logger 63 | { 64 | public function log($level, $msg, $append_crlf = TRUE) 65 | { 66 | } 67 | } 68 | ?> 69 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/SeleniumTestCase/append.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.10 44 | */ 45 | 46 | if ( isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && 47 | !isset($_GET['PHPUNIT_SELENIUM_TEST_ID']) && 48 | extension_loaded('xdebug')) { 49 | $GLOBALS['PHPUNIT_FILTERED_FILES'][] = __FILE__; 50 | 51 | $data = xdebug_get_code_coverage(); 52 | xdebug_stop_code_coverage(); 53 | 54 | foreach ($GLOBALS['PHPUNIT_FILTERED_FILES'] as $file) { 55 | unset($data[$file]); 56 | } 57 | 58 | if (is_string($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']) && 59 | is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) { 60 | $file = $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] . 61 | DIRECTORY_SEPARATOR . md5($_SERVER['SCRIPT_FILENAME']); 62 | } else { 63 | $file = $_SERVER['SCRIPT_FILENAME']; 64 | } 65 | 66 | file_put_contents( 67 | $file . '.' . md5(uniqid(rand(), TRUE)) . '.' . $_COOKIE['PHPUNIT_SELENIUM_TEST_ID'], 68 | serialize($data) 69 | ); 70 | } 71 | ?> 72 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/SeleniumTestCase/prepend.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.10 44 | */ 45 | 46 | // By default the code coverage files are written to the same directory 47 | // that contains the covered sourcecode files. Use this setting to change 48 | // the default behaviour and set a specific directory to write the files to. 49 | // If you change the default setting, please make sure to also configure 50 | // the same directory in phpunit_coverage.php. Also note that the webserver 51 | // needs write access to the directory. 52 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = FALSE; 53 | 54 | if ( isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && 55 | !isset($_GET['PHPUNIT_SELENIUM_TEST_ID']) && 56 | extension_loaded('xdebug')) { 57 | $GLOBALS['PHPUNIT_FILTERED_FILES'] = array(__FILE__); 58 | 59 | xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); 60 | } 61 | ?> 62 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/Given.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mattis Stordalen Flister 40 | * @author Sebastian Bergmann 41 | * @copyright 2002-2010 Sebastian Bergmann 42 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 43 | * @link http://www.phpunit.de/ 44 | * @since File available since Release 3.3.0 45 | */ 46 | 47 | require_once 'PHPUnit/Extensions/Story/Step.php'; 48 | require_once 'PHPUnit/Util/Filter.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * A "Given" step. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Mattis Stordalen Flister 58 | * @author Sebastian Bergmann 59 | * @copyright 2002-2010 Sebastian Bergmann 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.3.0 64 | */ 65 | class PHPUnit_Extensions_Story_Given extends PHPUnit_Extensions_Story_Step 66 | { 67 | /** 68 | * Returns this step's name. 69 | * 70 | * @return string 71 | */ 72 | public function getName() 73 | { 74 | return 'Given'; 75 | } 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/ResultPrinter/Template/scenario.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 |

[+] {name}

4 | 5 | 6 | 7 | 8 | 9 | {steps} 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/ResultPrinter/Template/scenario_header.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 |

{name}

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/ResultPrinter/Template/scenarios.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 29 | 30 | 31 | 32 | {scenarios} 33 | 34 | 57 | 58 |
35 |

[+] Summary:

36 | 56 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/ResultPrinter/Template/step.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {text} 3 | {action} 4 |   5 | 6 | 7 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/Then.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mattis Stordalen Flister 40 | * @author Sebastian Bergmann 41 | * @copyright 2002-2010 Sebastian Bergmann 42 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 43 | * @link http://www.phpunit.de/ 44 | * @since File available since Release 3.3.0 45 | */ 46 | 47 | require_once 'PHPUnit/Extensions/Story/Step.php'; 48 | require_once 'PHPUnit/Util/Filter.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * A "Then" step. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Mattis Stordalen Flister 58 | * @author Sebastian Bergmann 59 | * @copyright 2002-2010 Sebastian Bergmann 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.3.0 64 | */ 65 | class PHPUnit_Extensions_Story_Then extends PHPUnit_Extensions_Story_Step 66 | { 67 | /** 68 | * Returns this step's name. 69 | * 70 | * @return string 71 | */ 72 | public function getName() 73 | { 74 | return 'Then'; 75 | } 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Extensions/Story/When.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Mattis Stordalen Flister 40 | * @author Sebastian Bergmann 41 | * @copyright 2002-2010 Sebastian Bergmann 42 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 43 | * @link http://www.phpunit.de/ 44 | * @since File available since Release 3.3.0 45 | */ 46 | 47 | require_once 'PHPUnit/Extensions/Story/Step.php'; 48 | require_once 'PHPUnit/Util/Filter.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * A "When" step. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Mattis Stordalen Flister 58 | * @author Sebastian Bergmann 59 | * @copyright 2002-2010 Sebastian Bergmann 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.3.0 64 | */ 65 | class PHPUnit_Extensions_Story_When extends PHPUnit_Extensions_Story_Step 66 | { 67 | /** 68 | * Returns this step's name. 69 | * 70 | * @return string 71 | */ 72 | public function getName() 73 | { 74 | return 'When'; 75 | } 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Framework.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | require 'PHPUnit/Framework/Exception.php'; 51 | require 'PHPUnit/Framework/SelfDescribing.php'; 52 | require 'PHPUnit/Framework/AssertionFailedError.php'; 53 | require 'PHPUnit/Framework/Assert.php'; 54 | require 'PHPUnit/Framework/Error.php'; 55 | require 'PHPUnit/Framework/Error/Notice.php'; 56 | require 'PHPUnit/Framework/Error/Warning.php'; 57 | require 'PHPUnit/Framework/IncompleteTest.php'; 58 | require 'PHPUnit/Framework/SkippedTest.php'; 59 | require 'PHPUnit/Framework/Test.php'; 60 | require 'PHPUnit/Framework/TestFailure.php'; 61 | require 'PHPUnit/Framework/TestListener.php'; 62 | require 'PHPUnit/Framework/TestResult.php'; 63 | require 'PHPUnit/Framework/ExpectationFailedException.php'; 64 | require 'PHPUnit/Framework/IncompleteTestError.php'; 65 | require 'PHPUnit/Framework/SkippedTestError.php'; 66 | require 'PHPUnit/Framework/SkippedTestSuiteError.php'; 67 | require 'PHPUnit/Framework/TestCase.php'; 68 | require 'PHPUnit/Framework/TestSuite.php'; 69 | require 'PHPUnit/Framework/TestSuite/DataProvider.php'; 70 | require 'PHPUnit/Framework/Warning.php'; 71 | require 'PHPUnit/Framework/Constraint.php'; 72 | require 'PHPUnit/Framework/ComparisonFailure.php'; 73 | ?> 74 | -------------------------------------------------------------------------------- /PHPUnit/Framework/AssertionFailedError.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Thrown when an assertion failed. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Class available since Release 2.0.0 61 | */ 62 | class PHPUnit_Framework_AssertionFailedError extends Exception implements PHPUnit_Framework_SelfDescribing 63 | { 64 | /** 65 | * Wrapper for getMessage() which is declared as final. 66 | * 67 | * @return string 68 | */ 69 | public function toString() 70 | { 71 | return $this->getMessage(); 72 | } 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Framework/ComparisonFailure/Scalar.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Thrown when an assertion for scalar equality failed. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.0.0 62 | */ 63 | class PHPUnit_Framework_ComparisonFailure_Scalar extends PHPUnit_Framework_ComparisonFailure 64 | { 65 | /** 66 | * Returns a string describing the difference between the expected and the 67 | * actual scalar value. 68 | */ 69 | public function toString() 70 | { 71 | return ''; 72 | } 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Framework/ComparisonFailure/Type.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Thrown when an assertion for type equality failed. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.0.0 62 | */ 63 | class PHPUnit_Framework_ComparisonFailure_Type extends PHPUnit_Framework_ComparisonFailure 64 | { 65 | /** 66 | * Returns a string describing the type difference between the expected 67 | * and the actual value. 68 | */ 69 | public function toString() 70 | { 71 | return sprintf( 72 | '%s does not match expected type "%s".', 73 | 74 | PHPUnit_Util_Type::toString($this->actual), 75 | gettype($this->expected) 76 | ); 77 | } 78 | } 79 | ?> 80 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Constraint/IsFalse.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.3.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Constraint that accepts FALSE. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.3.0 62 | */ 63 | class PHPUnit_Framework_Constraint_IsFalse extends PHPUnit_Framework_Constraint 64 | { 65 | /** 66 | * Evaluates the constraint for parameter $other. Returns TRUE if the 67 | * constraint is met, FALSE otherwise. 68 | * 69 | * @param mixed $other Value or object to evaluate. 70 | * @return bool 71 | */ 72 | public function evaluate($other) 73 | { 74 | return $other === FALSE; 75 | } 76 | 77 | /** 78 | * Returns a string representation of the constraint. 79 | * 80 | * @return string 81 | */ 82 | public function toString() 83 | { 84 | return 'is false'; 85 | } 86 | } 87 | ?> 88 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Constraint/IsNull.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.3.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Constraint that accepts NULL. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.3.0 62 | */ 63 | class PHPUnit_Framework_Constraint_IsNull extends PHPUnit_Framework_Constraint 64 | { 65 | /** 66 | * Evaluates the constraint for parameter $other. Returns TRUE if the 67 | * constraint is met, FALSE otherwise. 68 | * 69 | * @param mixed $other Value or object to evaluate. 70 | * @return bool 71 | */ 72 | public function evaluate($other) 73 | { 74 | return $other === NULL; 75 | } 76 | 77 | /** 78 | * Returns a string representation of the constraint. 79 | * 80 | * @return string 81 | */ 82 | public function toString() 83 | { 84 | return 'is null'; 85 | } 86 | } 87 | ?> 88 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Constraint/IsTrue.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.3.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Constraint that accepts TRUE. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.3.0 62 | */ 63 | class PHPUnit_Framework_Constraint_IsTrue extends PHPUnit_Framework_Constraint 64 | { 65 | /** 66 | * Evaluates the constraint for parameter $other. Returns TRUE if the 67 | * constraint is met, FALSE otherwise. 68 | * 69 | * @param mixed $other Value or object to evaluate. 70 | * @return bool 71 | */ 72 | public function evaluate($other) 73 | { 74 | return $other === TRUE; 75 | } 76 | 77 | /** 78 | * Returns a string representation of the constraint. 79 | * 80 | * @return string 81 | */ 82 | public function toString() 83 | { 84 | return 'is true'; 85 | } 86 | } 87 | ?> 88 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Error.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Wrapper for PHP errors. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Class available since Release 2.2.0 61 | */ 62 | class PHPUnit_Framework_Error extends Exception 63 | { 64 | /** 65 | * Constructor. 66 | * 67 | * @param string $message 68 | * @param integer $code 69 | * @param string $file 70 | * @param integer $line 71 | * @param array $trace 72 | */ 73 | public function __construct($message, $code, $file, $line, $trace) 74 | { 75 | parent::__construct($message, $code); 76 | 77 | $this->file = $file; 78 | $this->line = $line; 79 | $this->trace = $trace; 80 | } 81 | } 82 | ?> 83 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Error/Notice.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.3.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Wrapper for PHP notices. 52 | * You can disable notice-to-exception conversion by setting 53 | * 54 | * 55 | * PHPUnit_Framework_Error_Notice::$enabled = FALSE; 56 | * 57 | * 58 | * @category Testing 59 | * @package PHPUnit 60 | * @author Sebastian Bergmann 61 | * @copyright 2002-2010 Sebastian Bergmann 62 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 63 | * @version Release: 3.4.13 64 | * @link http://www.phpunit.de/ 65 | * @since Class available since Release 3.3.0 66 | */ 67 | class PHPUnit_Framework_Error_Notice extends PHPUnit_Framework_Error 68 | { 69 | public static $enabled = TRUE; 70 | } 71 | ?> 72 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Error/Warning.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.3.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Wrapper for PHP warnings. 52 | * You can disable notice-to-exception conversion by setting 53 | * 54 | * 55 | * PHPUnit_Framework_Error_Warning::$enabled = FALSE; 56 | * 57 | * 58 | * @category Testing 59 | * @package PHPUnit 60 | * @author Sebastian Bergmann 61 | * @copyright 2002-2010 Sebastian Bergmann 62 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 63 | * @version Release: 3.4.13 64 | * @link http://www.phpunit.de/ 65 | * @since Class available since Release 3.3.0 66 | */ 67 | class PHPUnit_Framework_Error_Warning extends PHPUnit_Framework_Error 68 | { 69 | public static $enabled = TRUE; 70 | } 71 | ?> 72 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Exception.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | if (!class_exists('PHPUnit_Framework_Exception', FALSE)) { 51 | 52 | /** 53 | * Exception for PHPUnit runtime errors. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Sebastian Bergmann 58 | * @copyright 2002-2010 Sebastian Bergmann 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.4.0 63 | */ 64 | class PHPUnit_Framework_Exception extends RuntimeException 65 | { 66 | } 67 | 68 | } 69 | ?> 70 | -------------------------------------------------------------------------------- /PHPUnit/Framework/IncompleteTest.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * A marker interface for marking any exception/error as result of an unit 52 | * test as incomplete implementation or currently not implemented. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 2.0.0 62 | */ 63 | interface PHPUnit_Framework_IncompleteTest 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Framework/IncompleteTestError.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Extension to PHPUnit_Framework_AssertionFailedError to mark the special 52 | * case of an incomplete test. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 2.0.0 62 | */ 63 | class PHPUnit_Framework_IncompleteTestError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_IncompleteTest 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Builder/Identity.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Builder interface for unique identifiers. 52 | * 53 | * Defines the interface for recording unique identifiers. The identifiers 54 | * can be used to define the invocation order of expectations. The expectation 55 | * is recorded using id() and then defined in order using 56 | * PHPUnit_Framework_MockObject_Builder_Match::after(). 57 | * 58 | * @category Testing 59 | * @package PHPUnit 60 | * @author Sebastian Bergmann 61 | * @copyright 2002-2010 Sebastian Bergmann 62 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 63 | * @version Release: 3.4.13 64 | * @link http://www.phpunit.de/ 65 | * @since Interface available since Release 3.0.0 66 | */ 67 | interface PHPUnit_Framework_MockObject_Builder_Identity 68 | { 69 | /** 70 | * Sets the identification of the expectation to $id. 71 | * 72 | * @note The identifier is unique per mock object. 73 | * @param string $id Unique identifiation of expectation. 74 | */ 75 | public function id($id); 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Builder/Match.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Builder/Stub.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Builder interface for invocation order matches. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 3.0.0 62 | */ 63 | interface PHPUnit_Framework_MockObject_Builder_Match extends PHPUnit_Framework_MockObject_Builder_Stub 64 | { 65 | /** 66 | * Defines the expectation which must occur before the current is valid. 67 | * 68 | * @param string $id The identification of the expectation that should 69 | * occur before this one. 70 | * @return PHPUnit_Framework_MockObject_Builder_Stub 71 | */ 72 | public function after($id); 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Builder/ParametersMatch.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Builder interface for matcher of method names. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 3.0.0 62 | */ 63 | interface PHPUnit_Framework_MockObject_Builder_MethodNameMatch extends PHPUnit_Framework_MockObject_Builder_ParametersMatch 64 | { 65 | /** 66 | * Adds a new method name match and returns the parameter match object for 67 | * further matching possibilities. 68 | * 69 | * @param PHPUnit_Framework_Constraint $name 70 | * Constraint for matching method, if a string is passed it will use 71 | * the PHPUnit_Framework_Constraint_IsEqual. 72 | * @return PHPUnit_Framework_MockObject_Builder_ParametersMatch 73 | */ 74 | public function method($name); 75 | } 76 | ?> 77 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Builder/Stub.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Builder/Identity.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Builder interface for stubs which are actions replacing an invocation. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 3.0.0 62 | */ 63 | interface PHPUnit_Framework_MockObject_Builder_Stub extends PHPUnit_Framework_MockObject_Builder_Identity 64 | { 65 | /** 66 | * Stubs the matching method with the stub object $stub. Any invocations of 67 | * the matched method will now be handled by the stub instead. 68 | * 69 | * @param PHPUnit_Framework_MockObject_Stub $stub The stub object. 70 | * @return PHPUnit_Framework_MockObject_Builder_Identity 71 | */ 72 | public function will(PHPUnit_Framework_MockObject_Stub $stub); 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/mocked_class.tpl.dist: -------------------------------------------------------------------------------- 1 | {prologue}{class_declaration} 2 | { 3 | protected $invocationMocker; 4 | 5 | {clone}{mocked_methods} 6 | public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) 7 | { 8 | return $this->__phpunit_getInvocationMocker()->expects($matcher); 9 | } 10 | 11 | public function __phpunit_getInvocationMocker() 12 | { 13 | if ($this->invocationMocker === NULL) { 14 | $this->invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker($this); 15 | } 16 | 17 | return $this->invocationMocker; 18 | } 19 | 20 | public function __phpunit_verify() 21 | { 22 | $this->__phpunit_getInvocationMocker()->verify(); 23 | } 24 | 25 | public function __phpunit_cleanup() 26 | { 27 | $this->invocationMocker = NULL; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/mocked_clone.tpl.dist: -------------------------------------------------------------------------------- 1 | public function __clone() 2 | { 3 | $this->invocationMocker = clone $this->__phpunit_getInvocationMocker(); 4 | } 5 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/mocked_method.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | {modifier} function {reference}{method_name}({arguments}) 3 | { 4 | $args = func_get_args(); 5 | 6 | $result = $this->__phpunit_getInvocationMocker()->invoke( 7 | new PHPUnit_Framework_MockObject_Invocation( 8 | $this, '{class_name}', '{method_name}', $args 9 | ) 10 | ); 11 | 12 | return $result; 13 | } 14 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/unmocked_clone.tpl.dist: -------------------------------------------------------------------------------- 1 | public function __clone() 2 | { 3 | $this->invocationMocker = clone $this->__phpunit_getInvocationMocker(); 4 | parent::__clone(); 5 | } 6 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/wsdl_class.tpl.dist: -------------------------------------------------------------------------------- 1 | class {class_name} extends SOAPClient 2 | { 3 | public function __construct($wsdl, array $options) 4 | { 5 | parent::__construct('{wsdl}'); 6 | } 7 | {methods}} 8 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Generator/wsdl_method.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | public function {method_name}({arguments}) 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * Invocation matcher which checks if a method has been invoked zero or more 54 | * times. This matcher will always match. 55 | * 56 | * @category Testing 57 | * @package PHPUnit 58 | * @author Sebastian Bergmann 59 | * @copyright 2002-2010 Sebastian Bergmann 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 61 | * @version Release: 3.4.13 62 | * @link http://www.phpunit.de/ 63 | * @since Class available since Release 3.0.0 64 | */ 65 | class PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder 66 | { 67 | /** 68 | * @return string 69 | */ 70 | public function toString() 71 | { 72 | return 'invoked zero or more times'; 73 | } 74 | 75 | /** 76 | */ 77 | public function verify() 78 | { 79 | } 80 | } 81 | ?> 82 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Matcher/AnyParameters.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php'; 48 | require_once 'PHPUnit/Framework/MockObject/Invocation.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * Invocation matcher which allos any parameters to a method. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Sebastian Bergmann 58 | * @copyright 2002-2010 Sebastian Bergmann 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.0.0 63 | */ 64 | class PHPUnit_Framework_MockObject_Matcher_AnyParameters extends PHPUnit_Framework_MockObject_Matcher_StatelessInvocation 65 | { 66 | /** 67 | * @return string 68 | */ 69 | public function toString() 70 | { 71 | return 'with any parameters'; 72 | } 73 | 74 | /** 75 | * @param PHPUnit_Framework_MockObject_Invocation $invocation 76 | * @return boolean 77 | */ 78 | public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) 79 | { 80 | return TRUE; 81 | } 82 | } 83 | ?> 84 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Stub/MatcherCollection.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Matcher.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Stubs a method by returning a user-defined value. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 3.0.0 62 | */ 63 | interface PHPUnit_Framework_MockObject_Stub_MatcherCollection 64 | { 65 | /** 66 | * Adds a new matcher to the collection which can be used as an expectation 67 | * or a stub. 68 | * 69 | * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher 70 | * Matcher for invocations to mock objects. 71 | */ 72 | public function addMatcher(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher); 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Stub/Return.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | require_once 'PHPUnit/Framework/MockObject/Invocation.php'; 48 | require_once 'PHPUnit/Framework/MockObject/Stub.php'; 49 | 50 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 51 | 52 | /** 53 | * Stubs a method by returning a user-defined value. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Sebastian Bergmann 58 | * @copyright 2002-2010 Sebastian Bergmann 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.0.0 63 | */ 64 | class PHPUnit_Framework_MockObject_Stub_Return implements PHPUnit_Framework_MockObject_Stub 65 | { 66 | protected $value; 67 | 68 | public function __construct($value) 69 | { 70 | $this->value = $value; 71 | } 72 | 73 | public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) 74 | { 75 | return $this->value; 76 | } 77 | 78 | public function toString() 79 | { 80 | return sprintf( 81 | 'return user-specified value %s', 82 | 83 | PHPUnit_Util_Type::toString($this->value) 84 | ); 85 | } 86 | } 87 | ?> 88 | -------------------------------------------------------------------------------- /PHPUnit/Framework/MockObject/Verifiable.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Interface for classes which must verify a given expectation. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Interface available since Release 3.0.0 61 | */ 62 | interface PHPUnit_Framework_MockObject_Verifiable 63 | { 64 | /** 65 | * Verifies that the current expectation is valid. If everything is OK the 66 | * code should just return, if not it must throw an exception. 67 | * 68 | * @throws PHPUnit_Framework_ExpectationFailedException 69 | */ 70 | public function verify(); 71 | } 72 | ?> 73 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Process/TestCaseMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | collectRawCodeCoverageInformation({collectCodeCoverageInformation}); 10 | 11 | $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); 12 | $test->setDependencyInput(unserialize('{dependencyInput}')); 13 | $test->setInIsolation(TRUE); 14 | 15 | ob_end_clean(); 16 | ob_start(); 17 | $test->run($result); 18 | $output = ob_get_contents(); 19 | ob_end_clean(); 20 | 21 | print serialize( 22 | array( 23 | 'testResult' => $test->getResult(), 24 | 'numAssertions' => $test->getNumAssertions(), 25 | 'result' => $result, 26 | 'output' => $output 27 | ) 28 | ); 29 | 30 | ob_start(); 31 | } 32 | 33 | if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { 34 | require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; 35 | unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); 36 | } 37 | 38 | {constants} 39 | {globals} 40 | {included_files} 41 | 42 | __phpunit_run_isolated_test(); 43 | ob_end_clean(); 44 | ?> 45 | -------------------------------------------------------------------------------- /PHPUnit/Framework/SelfDescribing.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Interface for classes that can return a description of itself. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Interface available since Release 3.0.0 61 | */ 62 | interface PHPUnit_Framework_SelfDescribing 63 | { 64 | /** 65 | * Returns a string representation of the object. 66 | * 67 | * @return string 68 | */ 69 | public function toString(); 70 | } 71 | ?> 72 | -------------------------------------------------------------------------------- /PHPUnit/Framework/SkippedTest.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * A marker interface for marking a unit test as being skipped. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Interface available since Release 3.0.0 61 | */ 62 | interface PHPUnit_Framework_SkippedTest 63 | { 64 | } 65 | ?> 66 | -------------------------------------------------------------------------------- /PHPUnit/Framework/SkippedTestError.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Extension to PHPUnit_Framework_AssertionFailedError to mark the special 52 | * case of a skipped test. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.0.0 62 | */ 63 | class PHPUnit_Framework_SkippedTestError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_SkippedTest 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Framework/SkippedTestSuiteError.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.1.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Extension to PHPUnit_Framework_AssertionFailedError to mark the special 52 | * case of a skipped test suite. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.1.0 62 | */ 63 | class PHPUnit_Framework_SkippedTestSuiteError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_SkippedTest 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Framework/Test.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * A Test can be run and collect its results. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Interface available since Release 2.0.0 61 | */ 62 | interface PHPUnit_Framework_Test extends Countable 63 | { 64 | /** 65 | * Runs a test and collects its result in a TestResult instance. 66 | * 67 | * @param PHPUnit_Framework_TestResult $result 68 | * @return PHPUnit_Framework_TestResult 69 | */ 70 | public function run(PHPUnit_Framework_TestResult $result = NULL); 71 | } 72 | ?> 73 | -------------------------------------------------------------------------------- /PHPUnit/Framework/TestSuite/DataProvider.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.4.0 44 | */ 45 | 46 | require_once 'PHPUnit/Framework.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.4.0 62 | */ 63 | class PHPUnit_Framework_TestSuite_DataProvider extends PHPUnit_Framework_TestSuite 64 | { 65 | /** 66 | * Sets the dependencies of a TestCase. 67 | * 68 | * @param array $dependencies 69 | */ 70 | public function setDependencies(array $dependencies) 71 | { 72 | foreach ($this->tests as $test) { 73 | $test->setDependencies($dependencies); 74 | } 75 | } 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Runner/TestCollector.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Collects Test class names to be presented 52 | * by the TestSelector. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Interface available since Release 2.0.0 62 | */ 63 | interface PHPUnit_Runner_TestCollector 64 | { 65 | /** 66 | * @return array 67 | */ 68 | public function collectTests(); 69 | } 70 | ?> 71 | -------------------------------------------------------------------------------- /PHPUnit/Runner/TestSuiteLoader.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * An interface to define how a test suite should be loaded. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Interface available since Release 2.0.0 61 | */ 62 | interface PHPUnit_Runner_TestSuiteLoader 63 | { 64 | /** 65 | * @param string $suiteClassName 66 | * @param string $suiteClassFile 67 | * @return ReflectionClass 68 | */ 69 | public function load($suiteClassName, $suiteClassFile = ''); 70 | 71 | /** 72 | * @param ReflectionClass $aClass 73 | * @return ReflectionClass 74 | */ 75 | public function reload(ReflectionClass $aClass); 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /PHPUnit/Runner/Version.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 2.0.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * This class defines the current version of PHPUnit. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Class available since Release 2.0.0 61 | */ 62 | class PHPUnit_Runner_Version 63 | { 64 | /** 65 | * Returns the current version of PHPUnit. 66 | * 67 | * @return string 68 | */ 69 | public static function id() 70 | { 71 | return '3.4.13'; 72 | } 73 | 74 | /** 75 | * @return string 76 | */ 77 | public static function getVersionString() 78 | { 79 | return 'PHPUnit 3.4.13 by Sebastian Bergmann.'; 80 | } 81 | } 82 | ?> 83 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Metrics.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Abstract base class for PMD rule classes. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | abstract class PHPUnit_Util_Log_PMD_Rule 64 | { 65 | protected $threshold; 66 | protected $priority; 67 | 68 | public function __construct($threshold, $priority = 1) 69 | { 70 | $this->threshold = $threshold; 71 | $this->priority = $priority; 72 | } 73 | 74 | public function getName() 75 | { 76 | $name = explode('_', get_class($this)); 77 | 78 | return array_pop($name); 79 | } 80 | 81 | public function getPriority() 82 | { 83 | return $this->priority; 84 | } 85 | 86 | abstract public function apply(PHPUnit_Util_Metrics $metrics); 87 | } 88 | ?> 89 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule/Class.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Log/PMD/Rule.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Abstract base class for PMD rule classes that operate on the class-level. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | abstract class PHPUnit_Util_Log_PMD_Rule_Class extends PHPUnit_Util_Log_PMD_Rule 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule/Class/DepthOfInheritanceTree.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Log/PMD/Rule/Class.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | class PHPUnit_Util_Log_PMD_Rule_Class_DepthOfInheritanceTree extends PHPUnit_Util_Log_PMD_Rule_Class 64 | { 65 | public function __construct($threshold = 6, $priority = 1) 66 | { 67 | parent::__construct($threshold, $priority); 68 | } 69 | 70 | public function apply(PHPUnit_Util_Metrics $metrics) 71 | { 72 | $dit = $metrics->getDIT(); 73 | 74 | if ($dit > $this->threshold) { 75 | return sprintf( 76 | 'Depth of Inheritance Tree (DIT) is %d.', 77 | $dit 78 | ); 79 | } 80 | } 81 | } 82 | ?> 83 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule/File.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Log/PMD/Rule.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Abstract base class for PMD rule classes that operate on the file-level. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | abstract class PHPUnit_Util_Log_PMD_Rule_File extends PHPUnit_Util_Log_PMD_Rule 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule/Function.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Log/PMD/Rule.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Abstract base class for PMD rule classes that operate on the function- or 53 | * method-level. 54 | * 55 | * @category Testing 56 | * @package PHPUnit 57 | * @author Sebastian Bergmann 58 | * @copyright 2002-2010 Sebastian Bergmann 59 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 60 | * @version Release: 3.4.13 61 | * @link http://www.phpunit.de/ 62 | * @since Class available since Release 3.2.0 63 | */ 64 | abstract class PHPUnit_Util_Log_PMD_Rule_Function extends PHPUnit_Util_Log_PMD_Rule 65 | { 66 | } 67 | ?> 68 | -------------------------------------------------------------------------------- /PHPUnit/Util/Log/PMD/Rule/Project.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Log/PMD/Rule.php'; 47 | require_once 'PHPUnit/Util/Filter.php'; 48 | 49 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 50 | 51 | /** 52 | * Abstract base class for PMD rule classes that operate on the project-level. 53 | * 54 | * @category Testing 55 | * @package PHPUnit 56 | * @author Sebastian Bergmann 57 | * @copyright 2002-2010 Sebastian Bergmann 58 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 59 | * @version Release: 3.4.13 60 | * @link http://www.phpunit.de/ 61 | * @since Class available since Release 3.2.0 62 | */ 63 | abstract class PHPUnit_Util_Log_PMD_Rule_Project extends PHPUnit_Util_Log_PMD_Rule 64 | { 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /PHPUnit/Util/Metrics.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @category Testing 38 | * @package PHPUnit 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2010 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.2.0 44 | */ 45 | 46 | require_once 'PHPUnit/Util/Filter.php'; 47 | 48 | PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); 49 | 50 | /** 51 | * Abstract base class for metrics classes. 52 | * 53 | * @category Testing 54 | * @package PHPUnit 55 | * @author Sebastian Bergmann 56 | * @copyright 2002-2010 Sebastian Bergmann 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 58 | * @version Release: 3.4.13 59 | * @link http://www.phpunit.de/ 60 | * @since Class available since Release 3.2.0 61 | */ 62 | abstract class PHPUnit_Util_Metrics 63 | { 64 | } 65 | 66 | require_once 'PHPUnit/Util/Metrics/Project.php'; 67 | require_once 'PHPUnit/Util/Metrics/File.php'; 68 | require_once 'PHPUnit/Util/Metrics/Class.php'; 69 | require_once 'PHPUnit/Util/Metrics/Function.php'; 70 | ?> 71 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/butter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/butter.png -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/chameleon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/chameleon.png -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/close12_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/close12_1.gif -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/directory.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {title} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 38 | 39 | 40 | 41 | 42 |
{title}
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 35 | 36 |
Current directory:{link}
Legend: 25 | 26 | Low: 0% to {low_upper_bound}% 27 | 28 | 29 | Medium: {low_upper_bound}% to {high_lower_bound}% 30 | 31 | 32 | High: {high_lower_bound}% to 100% 33 | 34 |
37 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {total_item}{items} 59 |
 Coverage
 LinesFunctions / MethodsClasses
60 |
61 | 62 |
63 | 64 | 65 | 66 | 67 |
Generated by PHPUnit {phpunit_version} and Xdebug {xdebug_version} using PHP {php_version} at {date}.
68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/directory_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {name} 3 | 4 | 5 | 6 | 7 | 8 |
{lines_executed_percent}{lines_executed_percent}
9 | 10 | {lines_executed_percent} 11 | {num_executed_lines} / {num_executable_lines} 12 | 13 | 14 | 15 | 16 | 17 |
{methods_tested_percent}{methods_tested_percent}
18 | 19 | {methods_tested_percent} 20 | {methods_number} 21 | 22 | 23 | 24 | 25 | 26 |
{classes_tested_percent}{classes_tested_percent}
27 | 28 | {classes_tested_percent} 29 | {classes_number} 30 | 31 | 32 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/file_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {name} 3 | 4 | 5 | 6 | 7 | 8 |
{classes_tested_percent}{classes_tested_percent}
9 | 10 | {classes_tested_percent} 11 | {classes_number} 12 | 13 | 14 | 15 | 16 | 17 |
{methods_tested_percent}{methods_tested_percent}
18 | 19 | {methods_tested_percent} 20 | {methods_number} 21 | 22 | 23 | 24 | 25 | 26 |
{lines_executed_percent}{lines_executed_percent}
27 | 28 | {lines_executed_percent} 29 | {num_executed_lines} / {num_executable_lines} 30 | 31 | 32 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/file_no_yui.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {title} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 32 | 33 | 34 | 35 | 36 | 37 |
{title}
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 |
Current file:{link}
Legend: 25 | executed 26 | not executed 27 | dead code 28 |
31 |
38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {total_item}{items} 54 |
 Coverage
 ClassesFunctions / MethodsLines
55 |
56 | 57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 |

65 |
66 | {lines}
67 | 
68 |
71 | 72 | 73 | 74 | 75 |
Generated by PHPUnit {phpunit_version} and Xdebug {xdebug_version} at {date}.
76 | 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/glass.png -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/method_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {name} 3 | 4 | 5 | 6 | 7 | 8 |
{methods_tested_percent}{methods_tested_percent}
9 | 10 | {methods_tested_percent} 11 | {methods_number} 12 | 13 | 14 | 15 | 16 | 17 |
{lines_executed_percent}{lines_executed_percent}
18 | 19 | {lines_executed_percent} 20 | {num_executed_lines} / {num_executable_lines} 21 | 22 | 23 | -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/scarlet_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/scarlet_red.png -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewmueller/PHPUnit-Test-Report/6086b401f576ce002b1673a9fa1595c75f876038/PHPUnit/Util/Report/Template/snow.png -------------------------------------------------------------------------------- /PHPUnit/Util/Report/Template/yui_item.js: -------------------------------------------------------------------------------- 1 | "panel{line}": { 2 | "header": "{header}", 3 | "body": "
    {tests}
", 4 | "footer": "" 5 | }, 6 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/Class.tpl.dist: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/IncompleteTestMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @todo Implement test{methodName}(). 4 | */ 5 | public function test{methodName}() 6 | { 7 | // Remove the following lines when you implement this test. 8 | $this->markTestIncomplete( 9 | 'This test has not been implemented yet.' 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/Method.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @todo Implement {methodName}(). 4 | */ 5 | public function {methodName}() 6 | { 7 | // Remove the following line when you implement this method. 8 | throw new RuntimeException('Not yet implemented.'); 9 | } 10 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestClass.tpl.dist: -------------------------------------------------------------------------------- 1 | object = new {className}; 22 | } 23 | 24 | /** 25 | * Tears down the fixture, for example, closes a network connection. 26 | * This method is called after a test is executed. 27 | */ 28 | protected function tearDown() 29 | { 30 | } 31 | {methods}} 32 | ?> 33 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {expected}, 9 | $this->object->{origMethodName}({arguments}) 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethodBool.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | $this->object->{origMethodName}({arguments}) 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethodBoolStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {className}::{origMethodName}({arguments}) 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethodException.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | * @expectedException {expected} 5 | */ 6 | public function test{methodName}() 7 | { 8 | $this->object->{origMethodName}({arguments}); 9 | } 10 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethodExceptionStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | * @expectedException {expected} 5 | */ 6 | public function test{methodName}() 7 | { 8 | {className}::{origMethodName}({arguments}); 9 | } 10 | -------------------------------------------------------------------------------- /PHPUnit/Util/Skeleton/Template/TestMethodStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {expected}, 9 | {className}::{origMethodName}({arguments}) 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # PHPUnit Test Report 2 | 3 | Visualize your PHPUnit tests. You can learn how to set it up at: http://mattmueller.me/blog/phpunit-test-report-unit-testing-in-the-browser 4 | 5 | ![screenshot](http://mattmueller.me/blog/wp-content/uploads/2010/06/test21.png) 6 | 7 | ## No longer in active development 8 | 9 | I'd recommend you check out: https://github.com/NSinopoli/VisualPHPUnit, this guy has really taken the library to the next level! 10 | 11 | -------------------------------------------------------------------------------- /Sandbox.php: -------------------------------------------------------------------------------- 1 | '; 11 | 12 | $out = '
!
13 |
'.$type.': '.$e['message'].'
14 |
'.$e['line'].'
15 |
'.$e['file'].'
'; 16 | $right = '
'; 17 | 18 | 19 | 20 | return $left.$out.$right; 21 | } 22 | 23 | $results_so_far = ''; 24 | if(@ob_get_contents()) { 25 | $results_so_far = @ob_get_contents(); 26 | @ob_clean(); 27 | 28 | echo PHPUnit::toHTML($results_so_far); 29 | } 30 | 31 | 32 | if( false === is_null($aError = error_get_last()) ) { 33 | 34 | switch($aError['type']) { 35 | case E_NOTICE: 36 | echo toHTML("Notice", $aError); 37 | break; 38 | case E_WARNING: 39 | echo toHTML("Warning", $aError); 40 | break; 41 | case E_ERROR: 42 | echo toHTML("Error", $aError); 43 | break; 44 | case E_PARSE: 45 | echo toHTML("Parse", $aError); 46 | break; 47 | default: 48 | echo toHTML("Unknown", $aError); 49 | echo "
"; 50 | break; 51 | } 52 | 53 | 54 | } 55 | 56 | if($results_so_far) { 57 | include('Main/footer.php'); 58 | } 59 | 60 | exit(1); 61 | } 62 | 63 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------