You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2008/08/02 16:11:44 UTC
svn commit: r681982 [13/27] - in /incubator/shindig/trunk/php: external/
external/PHPUnit/ external/PHPUnit/Extensions/
external/PHPUnit/Extensions/Database/
external/PHPUnit/Extensions/Database/Constraint/
external/PHPUnit/Extensions/Database/DB/ exte...
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/OperationsTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/OperationsTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/OperationsTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/OperationsTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,178 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Mike Lively <m...@digitalsandwich.com>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: OperationsTest.php 2038 2008-01-08 09:38:47Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.2.0
+ */
+
+require_once 'PHPUnit/Extensions/Database/TestCase.php';
+require_once 'PHPUnit/Extensions/Database/DB/DefaultDatabaseConnection.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/FlatXmlDataSet.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultDataSet.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultTable.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultTableMetaData.php';
+
+require_once 'PHPUnit/Extensions/Database/Operation/Delete.php';
+require_once 'PHPUnit/Extensions/Database/Operation/DeleteAll.php';
+require_once 'PHPUnit/Extensions/Database/Operation/Insert.php';
+require_once 'PHPUnit/Extensions/Database/Operation/Update.php';
+require_once 'PHPUnit/Extensions/Database/Operation/Truncate.php';
+require_once 'PHPUnit/Extensions/Database/Operation/Replace.php';
+
+require_once 'Extensions/Database/_files/DatabaseTestUtility.php';
+
+/**
+ * @category Testing
+ * @package PHPUnit
+ * @author Mike Lively <m...@digitalsandwich.com>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: OperationsTest.php 2038 2008-01-08 09:38:47Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.2.0
+ */
+class Extensions_Database_Operation_OperationsTest extends PHPUnit_Extensions_Database_TestCase
+{
+ protected function setUp()
+ {
+ if (!extension_loaded('pdo_sqlite')) {
+ $this->markTestSkipped('PDO/SQLite is required to run this test.');
+ }
+
+ parent::setUp();
+ }
+
+ public function getConnection()
+ {
+ return new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection(DBUnitTestUtility::getSQLiteMemoryDB(), 'sqlite');
+ }
+
+ public function getDataSet()
+ {
+ return new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/OperationsTestFixture.xml');
+ }
+
+ public function testDelete()
+ {
+ $deleteOperation = new PHPUnit_Extensions_Database_Operation_Delete();
+
+ $deleteOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/DeleteOperationTest.xml'));
+
+ $this->assertDataSetsEqual(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/DeleteOperationResult.xml'), $this->getConnection()->createDataSet());
+ }
+
+ public function testDeleteAll()
+ {
+ $deleteAllOperation = new PHPUnit_Extensions_Database_Operation_DeleteAll();
+
+ $deleteAllOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/DeleteAllOperationTest.xml'));
+
+ $expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1',
+ array('table1_id', 'column1', 'column2', 'column3', 'column4'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2',
+ array('table2_id', 'column5', 'column6', 'column7', 'column8'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table3',
+ array('table3_id', 'column9', 'column10', 'column11', 'column12'))
+ ),
+ ));
+
+ $this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
+ }
+
+ public function testTruncate()
+ {
+ $truncateOperation = new PHPUnit_Extensions_Database_Operation_Truncate();
+
+ $truncateOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/DeleteAllOperationTest.xml'));
+
+ $expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1',
+ array('table1_id', 'column1', 'column2', 'column3', 'column4'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2',
+ array('table2_id', 'column5', 'column6', 'column7', 'column8'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table3',
+ array('table3_id', 'column9', 'column10', 'column11', 'column12'))
+ ),
+ ));
+
+ $this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
+ }
+
+ public function testInsert()
+ {
+ $insertOperation = new PHPUnit_Extensions_Database_Operation_Insert();
+
+ $insertOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/InsertOperationTest.xml'));
+
+ $this->assertDataSetsEqual(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/InsertOperationResult.xml'), $this->getConnection()->createDataSet());
+ }
+
+ public function testUpdate()
+ {
+ $updateOperation = new PHPUnit_Extensions_Database_Operation_Update();
+
+ $updateOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/UpdateOperationTest.xml'));
+
+ $this->assertDataSetsEqual(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/UpdateOperationResult.xml'), $this->getConnection()->createDataSet());
+ }
+
+ public function testReplace()
+ {
+ $replaceOperation = new PHPUnit_Extensions_Database_Operation_Replace();
+
+ $replaceOperation->execute($this->getConnection(), new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/ReplaceOperationTest.xml'));
+
+ $this->assertDataSetsEqual(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/ReplaceOperationResult.xml'), $this->getConnection()->createDataSet());
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/RowBasedTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/RowBasedTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/RowBasedTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/Operation/RowBasedTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,188 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Mike Lively <m...@digitalsandwich.com>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: RowBasedTest.php 2038 2008-01-08 09:38:47Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.2.0
+ */
+
+require_once 'PHPUnit/Extensions/Database/TestCase.php';
+require_once 'PHPUnit/Extensions/Database/DB/DefaultDatabaseConnection.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultDataSet.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultTable.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/DefaultTableMetaData.php';
+require_once 'PHPUnit/Extensions/Database/DataSet/FlatXmlDataSet.php';
+require_once 'PHPUnit/Extensions/Database/Operation/RowBased.php';
+
+require_once 'Extensions/Database/_files/DatabaseTestUtility.php';
+
+
+/**
+ * @category Testing
+ * @package PHPUnit
+ * @author Mike Lively <m...@digitalsandwich.com>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: RowBasedTest.php 2038 2008-01-08 09:38:47Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.2.0
+ */
+class Extensions_Database_Operation_RowBasedTest extends PHPUnit_Extensions_Database_TestCase
+{
+ protected function setUp()
+ {
+ if (!extension_loaded('pdo_sqlite')) {
+ $this->markTestSkipped('PDO/SQLite is required to run this test.');
+ }
+
+ parent::setUp();
+ }
+
+ public function getConnection()
+ {
+ return new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection(DBUnitTestUtility::getSQLiteMemoryDB(), 'sqlite');
+ }
+
+ public function getDataSet()
+ {
+ $tables = array(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1',
+ array('table1_id', 'column1', 'column2', 'column3', 'column4'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2',
+ array('table2_id', 'column5', 'column6', 'column7', 'column8'))
+ ),
+ new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table3',
+ array('table3_id', 'column9', 'column10', 'column11', 'column12'))
+ ),
+ );
+
+ return new PHPUnit_Extensions_Database_DataSet_DefaultDataSet($tables);
+ }
+
+ public function testExcecute()
+ {
+ $connection = $this->getConnection();
+ /* @var $connection PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection */
+ $table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('table1_id', 'column1', 'column2', 'column3', 'column4'))
+ );
+
+ $table1->addRow(array(
+ 'table1_id' => 1,
+ 'column1' => 'foo',
+ 'column2' => 42,
+ 'column3' => 4.2,
+ 'column4' => 'bar'
+ ));
+
+ $table1->addRow(array(
+ 'table1_id' => 2,
+ 'column1' => 'qwerty',
+ 'column2' => 23,
+ 'column3' => 2.3,
+ 'column4' => 'dvorak'
+ ));
+
+
+ $table2 = new PHPUnit_Extensions_Database_DataSet_DefaultTable(
+ new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2', array('table2_id', 'column5', 'column6', 'column7', 'column8'))
+ );
+
+ $table2->addRow(array(
+ 'table2_id' => 1,
+ 'column5' => 'fdyhkn',
+ 'column6' => 64,
+ 'column7' => 4568.64,
+ 'column8' => 'hkladfg'
+ ));
+
+ $dataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array($table1, $table2));
+
+ $mockOperation = $this->getMock('PHPUnit_Extensions_Database_Operation_RowBased',
+ array('buildOperationQuery', 'buildOperationArguments'));
+
+ /* @var $mockOperation PHPUnit_Framework_MockObject_MockObject */
+ $mockOperation->expects($this->at(0))
+ ->method('buildOperationQuery')
+ ->with($connection->createDataSet()->getTableMetaData('table1'), $table1)
+ ->will(
+ $this->returnValue('INSERT INTO table1 (table1_id, column1, column2, column3, column4) VALUES (?, ?, ?, ?, ?)')
+ );
+
+ $mockOperation->expects($this->at(1))
+ ->method('buildOperationArguments')
+ ->with($connection->createDataSet()->getTableMetaData('table1'), $table1, 0)
+ ->will(
+ $this->returnValue(array(1, 'foo', 42, 4.2, 'bar'))
+ );
+
+ $mockOperation->expects($this->at(2))
+ ->method('buildOperationArguments')
+ ->with($connection->createDataSet()->getTableMetaData('table1'), $table1, 1)
+ ->will(
+ $this->returnValue(array(2, 'qwerty', 23, 2.3, 'dvorak'))
+ );
+
+ $mockOperation->expects($this->at(3))
+ ->method('buildOperationQuery')
+ ->with($connection->createDataSet()->getTableMetaData('table2'), $table2)
+ ->will(
+ $this->returnValue('INSERT INTO table2 (table2_id, column5, column6, column7, column8) VALUES (?, ?, ?, ?, ?)')
+ );
+
+ $mockOperation->expects($this->at(4))
+ ->method('buildOperationArguments')
+ ->with($connection->createDataSet()->getTableMetaData('table2'), $table2, 0)
+ ->will(
+ $this->returnValue(array(1, 'fdyhkn', 64, 4568.64, 'hkladfg'))
+ );
+
+ /* @var $mockOperation PHPUnit_Extensions_Database_Operation_RowBased */
+ $mockOperation->execute($connection, $dataSet);
+
+ $this->assertDataSetsEqual(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__).'/../_files/XmlDataSets/RowBasedExecute.xml'), $connection->createDataSet(array('table1', 'table2')));
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteAllOperationTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteAllOperationTest.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteAllOperationTest.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteAllOperationTest.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" />
+ <table2 table2_id="1" />
+ <table3 table3_id="1" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationResult.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationResult.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationResult.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationResult.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationTest.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationTest.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/DeleteOperationTest.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="2" />
+ <table3 table3_id="2" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestComparison.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestComparison.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestComparison.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestComparison.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
+ <table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestFixture.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestFixture.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestFixture.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FilteredTestFixture.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
+ <table3 column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
+ <table3 column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FlatXmlDataSet.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FlatXmlDataSet.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FlatXmlDataSet.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/FlatXmlDataSet.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="tgfahgasdf" column2="200" column3="34.64" column4="yghkf;a hahfg8ja h;" />
+ <table1 table1_id="2" column1="hk;afg" column2="654" column3="46.54" column4="24rwehhads" />
+ <table1 table1_id="3" column1="ha;gyt" column2="462" column3="1654.4" column4="asfgklg" />
+ <table2 table2_id="1" column5="fhah" column6="456" column7="46.5" column8="fsdbghfdas" />
+ <table2 table2_id="2" column5="asdhfoih" column6="654" column8="43asdfhgj" />
+ <table2 table2_id="3" column5="ajsdlkfguitah" column6="654" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationResult.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationResult.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationResult.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationResult.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
+ <table1 table1_id="3" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
+ <table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+ <table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationTest.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationTest.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/InsertOperationTest.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="3" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/OperationsTestFixture.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/OperationsTestFixture.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/OperationsTestFixture.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/OperationsTestFixture.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
+ <table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationResult.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationResult.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationResult.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationResult.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="jgfdasg" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table1 table1_id="3" column1="ggfdsa" column2="45" column3="1.4" column4="asfhajj" />
+ <table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table2 table2_id="2" column5="gasupj" column6="9165" column7="456.65" column8="asfdh sdghkj" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+ <table3 table3_id="4" column9="asdfgaf" column10="152" column11="465.4" column12="dsafhl;a sji[uh ;" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationTest.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationTest.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/ReplaceOperationTest.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="2" column1="jgfdasg" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table1 table1_id="3" column1="ggfdsa" column2="45" column3="1.4" column4="asfhajj" />
+ <table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table2 table2_id="2" column5="gasupj" column6="9165" column7="456.65" column8="asfdh sdghkj" />
+ <table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+ <table3 table3_id="4" column9="asdfgaf" column10="152" column11="465.4" column12="dsafhl;a sji[uh ;" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/RowBasedExecute.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/RowBasedExecute.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/RowBasedExecute.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/RowBasedExecute.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
+ <table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationResult.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationResult.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationResult.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationResult.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
+ <table1 table1_id="2" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
+ <table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+ <table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationTest.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationTest.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/UpdateOperationTest.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table1 table1_id="2" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
+ <table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
+ <table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/XmlDataSet.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/XmlDataSet.xml?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/XmlDataSet.xml (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/Database/_files/XmlDataSets/XmlDataSet.xml Sat Aug 2 07:11:35 2008
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <table name="table1">
+ <column>table1_id</column>
+ <column>column1</column>
+ <column>column2</column>
+ <column>column3</column>
+ <column>column4</column>
+ <row>
+ <value>1</value>
+ <value>tgfahgasdf</value>
+ <value>200</value>
+ <value>34.64</value>
+ <value>yghkf;a hahfg8ja h;</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>hk;afg</value>
+ <value>654</value>
+ <value>46.54</value>
+ <value>24rwehhads</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>ha;gyt</value>
+ <value>462</value>
+ <value>1654.4</value>
+ <value>asfgklg</value>
+ </row>
+ </table>
+ <table name="table2">
+ <column>table2_id</column>
+ <column>column5</column>
+ <column>column6</column>
+ <column>column7</column>
+ <column>column8</column>
+ <row>
+ <value>1</value>
+ <value>fhah</value>
+ <value>456</value>
+ <value>46.5</value>
+ <value>fsdbghfdas</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>asdhfoih</value>
+ <value>654</value>
+ <null />
+ <value>43asdfhgj</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>ajsdlkfguitah</value>
+ <value>654</value>
+ <null />
+ <null />
+ </row>
+ </table>
+ <table1 table1_id="1" column1="tgfahgasdf" column2="200" column3="34.64" column4="yghkf;a hahfg8ja h;" />
+ <table1 table1_id="2" column1="hk;afg" column2="654" column3="46.54" column4="24rwehhads" />
+ <table1 table1_id="3" column1="ha;gyt" column2="462" column3="1654.4" column4="asfgklg" />
+ <table2 table2_id="1" column5="fhah" column6="456" column7="46.5" column8="fsdbghfdas" />
+ <table2 table2_id="2" column5="asdhfoih" column6="654" column8="43asdfhgj" />
+ <table2 table2_id="3" column5="ajsdlkfguitah" column6="654" />
+</dataset>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/OutputTestCaseTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/OutputTestCaseTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/OutputTestCaseTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/OutputTestCaseTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,101 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: OutputTestCaseTest.php 1985 2007-12-26 18:11:55Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.0.0
+ */
+
+require_once 'PHPUnit/Framework/TestCase.php';
+
+require_once '_files/OutputTestCase.php';
+
+/**
+ *
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 3.2.9
+ * @link http://www.phpunit.de/
+ * @since Class available since Release 3.0.0
+ */
+class Extensions_OutputTestCaseTest extends PHPUnit_Framework_TestCase
+{
+ public function testExpectOutputStringFooActualFoo()
+ {
+ $test = new OutputTestCase('testExpectOutputStringFooActualFoo');
+ $result = $test->run();
+
+ $this->assertEquals(1, count($result));
+ $this->assertTrue($result->wasSuccessful());
+ }
+
+ public function testExpectOutputStringFooActualBar()
+ {
+ $test = new OutputTestCase('testExpectOutputStringFooActualBar');
+ $result = $test->run();
+
+ $this->assertEquals(1, count($result));
+ $this->assertFalse($result->wasSuccessful());
+ }
+
+ public function testExpectOutputRegexFooActualFoo()
+ {
+ $test = new OutputTestCase('testExpectOutputRegexFooActualFoo');
+ $result = $test->run();
+
+ $this->assertEquals(1, count($result));
+ $this->assertTrue($result->wasSuccessful());
+ }
+
+ public function testExpectOutputRegexFooActualBar()
+ {
+ $test = new OutputTestCase('testExpectOutputRegexFooActualBar');
+ $result = $test->run();
+
+ $this->assertEquals(1, count($result));
+ $this->assertFalse($result->wasSuccessful());
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/PerformanceTestCaseTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/PerformanceTestCaseTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/PerformanceTestCaseTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/PerformanceTestCaseTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,85 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: PerformanceTestCaseTest.php 1985 2007-12-26 18:11:55Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 2.0.0
+ */
+
+require_once 'PHPUnit/Framework/AssertionFailedError.php';
+require_once 'PHPUnit/Framework/TestCase.php';
+require_once 'PHPUnit/Framework/TestResult.php';
+
+require_once '_files/Sleep.php';
+
+/**
+ *
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 3.2.9
+ * @link http://www.phpunit.de/
+ * @since Class available since Release 2.0.0
+ */
+class Extensions_PerformanceTestCaseTest extends PHPUnit_Framework_TestCase
+{
+ public function testDoesNotExceedMaxRunningTime()
+ {
+ $test = new Sleep('testSleepTwoSeconds');
+ $test->setMaxRunningTime(3);
+
+ $result = $test->run();
+ $this->assertEquals(0, $result->failureCount());
+ }
+
+ public function testExceedsMaxRunningTime()
+ {
+ $test = new Sleep('testSleepTwoSeconds');
+ $test->setMaxRunningTime(1);
+
+ $result = $test->run();
+ $this->assertEquals(1, $result->failureCount());
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/RepeatedTestTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/RepeatedTestTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/RepeatedTestTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/RepeatedTestTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,118 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: RepeatedTestTest.php 1985 2007-12-26 18:11:55Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 2.0.0
+ */
+
+require_once 'PHPUnit/Framework/TestCase.php';
+require_once 'PHPUnit/Framework/TestResult.php';
+require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Extensions/RepeatedTest.php';
+
+require_once '_files/Success.php';
+
+/**
+ *
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 3.2.9
+ * @link http://www.phpunit.de/
+ * @since Class available since Release 2.0.0
+ */
+class Extensions_RepeatedTestTest extends PHPUnit_Framework_TestCase
+{
+ protected $suite;
+
+ public function __construct()
+ {
+ $this->suite = new PHPUnit_Framework_TestSuite;
+
+ $this->suite->addTest(new Success);
+ $this->suite->addTest(new Success);
+ }
+
+ public function testRepeatedOnce()
+ {
+ $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 1);
+ $this->assertEquals(2, count($test));
+
+ $result = $test->run();
+ $this->assertEquals(2, count($result));
+ }
+
+ public function testRepeatedMoreThanOnce()
+ {
+ $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 3);
+ $this->assertEquals(6, count($test));
+
+ $result = $test->run();
+ $this->assertEquals(6, count($result));
+ }
+
+ public function testRepeatedZero()
+ {
+ $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 0);
+ $this->assertEquals(0, count($test));
+
+ $result = $test->run();
+ $this->assertEquals(0, count($result));
+ }
+
+ public function testRepeatedNegative()
+ {
+ try {
+ $test = new PHPUnit_Extensions_RepeatedTest($this->suite, -1);
+ }
+
+ catch (Exception $e) {
+ return;
+ }
+
+ $this->fail('Should throw an Exception');
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/SeleniumTestCaseTest.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/SeleniumTestCaseTest.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/SeleniumTestCaseTest.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Extensions/SeleniumTestCaseTest.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,164 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @author Sebastian Nohn <se...@nohn.net>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: SeleniumTestCaseTest.php 1985 2007-12-26 18:11:55Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 3.0.0
+ */
+
+require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+
+/**
+ * Tests for PHPUnit_Extensions_SeleniumTestCase.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @author Sebastian Nohn <se...@nohn.net>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 3.2.9
+ * @link http://www.phpunit.de/
+ * @since Class available since Release 3.0.0
+ */
+class Extensions_SeleniumTestCaseTest extends PHPUnit_Extensions_SeleniumTestCase
+{
+ public function setUp()
+ {
+ if (!PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_ENABLED) {
+ $this->markTestSkipped(
+ 'The Selenium tests are disabled.'
+ );
+ }
+
+ $this->setHost(PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_HOST);
+ $this->setPort(PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_PORT);
+ $this->setBrowser(PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_BROWSER);
+ $this->setBrowserUrl('http://www.openqa.org/');
+ $this->setTimeout(10000);
+ }
+
+ public function testOpen()
+ {
+ $this->open('http://www.openqa.org/selenium-core/demo/passing/html/test_open.html');
+ $this->assertTextPresent('This is a test of the open command.');
+ }
+
+ public function testClick()
+ {
+ $this->open('http://www.openqa.org/selenium-core/demo/passing/html/test_click_page1.html');
+ $this->assertElementContainsText('nextPage', 'Click here for next page');
+ $this->clickAndWait('nextPage');
+ $this->assertLocationEquals('http://www.openqa.org/selenium-core/demo/passing/html/test_click_page2.html');
+ $this->assertTextPresent('This is a test of the click command.');
+ $this->clickAndWait('previousPage');
+ $this->assertLocationEquals('http://www.openqa.org/selenium-core/demo/passing/html/test_click_page1.html');
+ }
+
+ public function testType()
+ {
+ $this->open('http://www.openqa.org/selenium-core/demo/passing/html/test_type_page1.html');
+ $this->assertElementPresent('username');
+ $this->type('username', 'TestUser');
+ $this->assertElementValueEquals('username', 'TestUser');
+ $this->assertElementPresent('password');
+ $this->type('password', 'testUserPassword');
+ $this->assertElementValueEquals('password', 'testUserPassword');
+ $this->clickAndWait('submitButton');
+ $this->assertTextPresent('Welcome, TestUser!');
+ }
+
+ public function testOpenFail()
+ {
+ $this->open('http://www.openqa.org/selenium-core/demo/failing/html/test_open.html');
+
+ try {
+ $this->assertTextPresent('This test has been modified so it will fail.');
+ }
+
+ catch (Exception $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
+ public function testTypeFail()
+ {
+ $this->open('http://www.openqa.org/selenium-core/demo/failing/html/test_type_page1.html');
+ $this->assertElementPresent('username');
+ $this->type('username', 'TestUser');
+ $this->assertElementValueEquals('username', 'TestUser');
+ $this->assertElementPresent('password');
+ $this->type('password', 'usersPassword');
+
+ try {
+ $this->assertElementValueEquals('password', 'testUserPassword');
+ }
+
+ catch (Exception $e) {
+ return;
+ }
+
+ $this->fail();
+ }
+
+ public function testInPlaceEditor()
+ {
+ $this->open('http://www.openqa.org/selenium-core/ajaxdemo/scriptaculous-js-1.6.1/test/functional/ajax_inplaceeditor_test.html');
+ $this->mouseOver('tobeedited');
+ $this->click('tobeedited');
+ $this->assertNotVisible('tobeedited');
+ $this->assertElementPresent('tobeedited-inplaceeditor');
+ $this->click('link=cancel');
+ $this->assertElementContainsText('tobeedited', 'To be edited');
+ $this->assertVisible('tobeedited');
+ $this->click('tobeedited');
+ $this->click("//input[@class='editor_ok_button']");
+ $this->assertVisible('tobeedited');
+# $this->waitForText('tobeedited', 'Server received: To be edited');
+ // Workaround for not yet implemented waitForText
+ sleep(1);
+ $this->assertElementContainsText('tobeedited', 'Server received: To be edited');
+ }
+}
+?>
Added: incubator/shindig/trunk/php/external/PHPUnit/Tests/Framework/AllTests.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/external/PHPUnit/Tests/Framework/AllTests.php?rev=681982&view=auto
==============================================================================
--- incubator/shindig/trunk/php/external/PHPUnit/Tests/Framework/AllTests.php (added)
+++ incubator/shindig/trunk/php/external/PHPUnit/Tests/Framework/AllTests.php Sat Aug 2 07:11:35 2008
@@ -0,0 +1,108 @@
+<?php
+/**
+ * PHPUnit
+ *
+ * Copyright (c) 2002-2008, Sebastian Bergmann <sb...@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version SVN: $Id: AllTests.php 1985 2007-12-26 18:11:55Z sb $
+ * @link http://www.phpunit.de/
+ * @since File available since Release 2.0.0
+ */
+
+require_once 'PHPUnit/Util/Filter.php';
+
+PHPUnit_Util_Filter::addFileToFilter(__FILE__);
+
+if (!defined('PHPUnit_MAIN_METHOD')) {
+ define('PHPUnit_MAIN_METHOD', 'Framework_AllTests::main');
+ chdir(dirname(dirname(__FILE__)));
+}
+
+require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+require_once 'PHPUnit/Util/Filter.php';
+
+require_once 'Framework/AssertTest.php';
+require_once 'Framework/ComparisonFailureTest.php';
+require_once 'Framework/ConstraintTest.php';
+require_once 'Framework/MockObjectTest.php';
+require_once 'Framework/SuiteTest.php';
+require_once 'Framework/TestCaseTest.php';
+require_once 'Framework/TestImplementorTest.php';
+require_once 'Framework/TestListenerTest.php';
+
+/**
+ *
+ *
+ * @category Testing
+ * @package PHPUnit
+ * @author Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @copyright 2002-2008 Sebastian Bergmann <sb...@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 3.2.9
+ * @link http://www.phpunit.de/
+ * @since Class available since Release 2.0.0
+ */
+class Framework_AllTests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit_Framework');
+
+ $suite->addTestSuite('Framework_AssertTest');
+ $suite->addTestSuite('Framework_ComparisonFailureTest');
+ $suite->addTestSuite('Framework_ConstraintTest');
+ $suite->addTestSuite('Framework_MockObjectTest');
+ $suite->addTestSuite('Framework_SuiteTest');
+ $suite->addTestSuite('Framework_TestCaseTest');
+ $suite->addTestSuite('Framework_TestImplementorTest');
+ $suite->addTestSuite('Framework_TestListenerTest');
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'Framework_AllTests::main') {
+ Framework_AllTests::main();
+}
+?>