Skip to content

Commit

Permalink
upgrade to phpunit 6 (#15)
Browse files Browse the repository at this point in the history
* upgrade to phpunit 6

* change setExpectedException to expectedException*

* fix expectedException calls to expectException

* minimum php version is now 7.0

* update phpcov dependency
  • Loading branch information
aripringle authored and jaydiablo committed Jan 31, 2018
1 parent 466cc59 commit f069fbd
Show file tree
Hide file tree
Showing 1,115 changed files with 4,052 additions and 5,990 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ language: php
sudo: false

php:
- 5.6
- 7
- 7.1
- 7.2
Expand Down
13 changes: 4 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.6.0"
"php": ">=7.0.0"
},
"autoload": {
"psr-0": {
Expand All @@ -22,15 +22,10 @@
"config": {
"bin-dir": "bin"
},
"extra": {
"branch-alias": {
"dev-master": "1.12.x-dev"
}
},
"require-dev": {
"phpunit/phpunit": "5.*",
"phpunit/dbunit": "1.3.*",
"phpunit/phpcov": "^3.0"
"phpunit/phpunit": "^6.0",
"phpunit/dbunit": "^3.0.2",
"phpunit/phpcov": "^4.0"
},
"archive": {
"exclude": ["/demos", "/documentation", "/tests"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Wie im <link linkend="zend.test.phpunit.loginexample">Login-Beispiel</link> gezeigt, sollten
alle <acronym>MVC</acronym>-Testfälle
<classname>Zend_Test_PHPUnit_ControllerTestCase</classname> erweitern. Diese Klasse
ihrerseits erweitert <classname>PHPUnit_Framework_TestCase</classname> und gibt einem alle
ihrerseits erweitert <classname>PHPUnit\Framework\TestCase</classname> und gibt einem alle
Strukturen und Zusicherungen, die man von PHPUnit erwartet -- sowie einiges an Scaffolding und
Zusicherungen, die genau auf die Zend Framework <acronym>MVC</acronym>-Implementation zugeschnitten sind.
</para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
abgespeichert wird. Zuerst müssen wir eine Test-Klasse erstellen die
<classname>Zend_Test_PHPUnit_DatabaseTestCase</classname> erweitert. Diese Klasse
erweitert die Datenbank Erweiterung von PHPUnit, welche Ihrerseits den standardmäßigen
Basis <classname>PHPUnit_Framework_TestCase</classname> erweitert. Ein Datenbank
Basis <classname>PHPUnit\Framework\TestCase</classname> erweitert. Ein Datenbank
Testcase enthält zwei abstrakte Methoden die implementiert werden müssen, eine für die
Datenbank Verbindung und eine für das initiale Datenset das als Seed oder Fixum
verwendet werden soll.
Expand All @@ -37,7 +37,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
/**
* Returns the test database connection.
*
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @return PHPUnit\DbUnit\Database\Connection
*/
protected function getConnection()
{
Expand All @@ -52,7 +52,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
}
/**
* @return PHPUnit_Extensions_Database_DataSet_IDataSet
* @return PHPUnit\DbUnit\DataSet\IDataSet
*/
protected function getDataSet()
{
Expand Down Expand Up @@ -98,7 +98,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
<listitem>
<para>
DataSets müssen das Interface
<classname>PHPUnit_Extensions_Database_DataSet_IDataSet</classname>
<classname>PHPUnit\DbUnit\DataSet\IDataSet</classname>
implementieren. Es gibt eine Vielzahl an Typen von <acronym>XML</acronym> und
YAML Konfigurationsdateien die in PHPUnit enthalten sind, welche es erlauben zu
spezifizieren wie Tabellen und Datensätze auszusehen haben und man sollte in die
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<para>
Die Klasse <classname>Zend_Test_PHPUnit_DatabaseTestCase</classname> ist von
<classname>PHPUnit_Extensions_Database_TestCase</classname> abgeleitet welche es
<classname>PHPUnit\DbUnit\TestCase</classname> abgeleitet welche es
erlaubt Tests mit einer frischen und fixen Datenbank einfach für jeden Lauf zu
erstellen. Die Implementation von Zend bietet einige bequeme zusätzliche Features
über die Database Erweiterung von PHPUnit wenn es zur Verwendung von
Expand Down Expand Up @@ -110,7 +110,7 @@

<para>
Die nächste Tabelle listet nur die neuen Methoden verglichen mit
<classname>PHPUnit_Extensions_Database_TestCase</classname> auf, dessen <ulink
<classname>PHPUnit\DbUnit\TestCase</classname> auf, dessen <ulink
url="http://www.phpunit.de/manual/current/en/database.html">API in der
Dokumentation von PHPUnit dokumentiert ist</ulink>.
</para>
Expand Down Expand Up @@ -239,7 +239,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
$databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection);
$databaseFixture =
new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(
new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(
dirname(__FILE__) . '/_files/initialUserFixture.xml'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
As noted in the <link linkend="zend.test.phpunit.loginexample">Login
example</link>, all <acronym>MVC</acronym> test cases should extend
<classname>Zend_Test_PHPUnit_ControllerTestCase</classname>. This class in turn
extends <classname>PHPUnit_Framework_TestCase</classname>, and gives you all the
extends <classname>PHPUnit\Framework\TestCase</classname>, and gives you all the
structure and assertions you'd expect from PHPUnit -- as well as some
scaffolding and assertions specific to Zend Framework's <acronym>MVC</acronym>
implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup a test-class that extends
<classname>Zend_Test_PHPUnit_DatabaseTestCase</classname>. This class extends the
PHPUnit Database Extension, which in turn extends the basic
<classname>PHPUnit_Framework_TestCase</classname>. A database testcase contains two
<classname>PHPUnit\Framework\TestCase</classname>. A database testcase contains two
abstract methods that have to be implemented, one for the database connection and
one for the initial dataset that should be used as seed or fixture.
</para>
Expand All @@ -34,7 +34,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
/**
* Returns the test database connection.
*
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @return PHPUnit\DbUnit\Database\Connection
*/
protected function getConnection()
{
Expand All @@ -49,7 +49,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
}
/**
* @return PHPUnit_Extensions_Database_DataSet_IDataSet
* @return PHPUnit\DbUnit\DataSet\IDataSet
*/
protected function getDataSet()
{
Expand Down Expand Up @@ -94,7 +94,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
<listitem>
<para>
DataSets have to implement the interface
<classname>PHPUnit_Extensions_Database_DataSet_IDataSet</classname>.
<classname>PHPUnit\DbUnit\DataSet\IDataSet</classname>.
There is a wide range of <acronym>XML</acronym> and YAML configuration file
types included in PHPUnit which allows to specifiy how the tables and datasets
should look like and you should look into the PHPUnit documentation to get the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<para>
The <classname>Zend_Test_PHPUnit_DatabaseTestCase</classname> class derives from the
<classname>PHPUnit_Extensions_Database_TestCase</classname> which allows to setup tests
<classname>PHPUnit\DbUnit\TestCase</classname> which allows to setup tests
with a fresh database fixture on each run easily. The Zend implementation offers some
additional convenience features over the PHPUnit Database extension when it comes to
using <classname>Zend_Db</classname> resources inside your tests. The workflow of a
Expand Down Expand Up @@ -103,7 +103,7 @@

<para>
The next table lists only the new methods compared to the
<classname>PHPUnit_Extensions_Database_TestCase</classname>, whose <ulink
<classname>PHPUnit\DbUnit\TestCase</classname>, whose <ulink
url="http://www.phpunit.de/manual/current/en/database.html">API is documented in
the PHPUnit Documentation</ulink>.
</para>
Expand Down Expand Up @@ -228,7 +228,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
$databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection);
$databaseFixture =
new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(
new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(
dirname(__FILE__) . '/_files/initialUserFixture.xml'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Comme noté dans <link linkend="zend.test.phpunit.loginexample">l'exemple de
login</link>, tous les tests <acronym>MVC</acronym> doivent étendre
<classname>Zend_Test_PHPUnit_ControllerTestCase</classname>. Cette classe étend elle-même
<classname>PHPUnit_Framework_TestCase</classname>, et vous fournit donc toute la structure et les
<classname>PHPUnit\Framework\TestCase</classname>, et vous fournit donc toute la structure et les
assertions que vous attendez de PHPUnit - ainsi que quelques échafaudages et assertions
spécifiques à l'implémentation <acronym>MVC</acronym> de Zend Framework.
</para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
de tests sous forme de classe étendant
<classname>Zend_Test_PHPUnit_DatabaseTestCase</classname>. Cette classe étend elle-
même PHPUnit Database Extension, qui étend alors
<classname>PHPUnit_Framework_TestCase</classname>. Un cas de test pour base de données
<classname>PHPUnit\Framework\TestCase</classname>. Un cas de test pour base de données
contient deux méthodes abstraites à définir, une concernant la connexion à la base et
l'autre concernant les données à utiliser comme source pour les tests.
</para>
Expand All @@ -36,7 +36,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
/**
* Retourne la connexion de test
*
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @return PHPUnit\DbUnit\Database\Connection
*/
protected function getConnection()
{
Expand All @@ -51,7 +51,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
}
/**
* @return PHPUnit_Extensions_Database_DataSet_IDataSet
* @return PHPUnit\DbUnit\DataSet\IDataSet
*/
protected function getDataSet()
{
Expand Down Expand Up @@ -94,7 +94,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase
<listitem>
<para>
Les jeux de données (DataSets) doivent implémenter
<classname>PHPUnit_Extensions_Database_DataSet_IDataSet</classname>.
<classname>PHPUnit\DbUnit\DataSet\IDataSet</classname>.
Il en existe quelques uns, basés sur <acronym>XML</acronym> ou YAML et
ils sont inclus dans PHPUnit et permettent de décrire les données fictives pour
les tests. Vous devriez vous reporter à la documentation de PHPUnit pour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<para>
La classe <classname>Zend_Test_PHPUnit_DatabaseTestCase</classname> étend
<classname>PHPUnit_Extensions_Database_TestCase</classname>, celle-ci permet de configurer
<classname>PHPUnit\DbUnit\TestCase</classname>, celle-ci permet de configurer
un jeu de données concernant la base, pour chaque test. L'implementation du Zend Framework
offre quelques fonctionalités supplémentaires par rapport à l'extension PHPUnit concernant
les bases de données, ceci dans le but d'utiliser des ressources provenant de
Expand Down Expand Up @@ -101,7 +101,7 @@

<para>
Le tableau suivant liste uniquement les nouvelles méthodes par rapport à la classe
<classname>PHPUnit_Extensions_Database_TestCase</classname>, dont l'<ulink
<classname>PHPUnit\DbUnit\TestCase</classname>, dont l'<ulink
url="http://www.phpunit.de/manual/current/en/database.html">API est documentée dans
la documentation de PHPUnit</ulink>.
</para>
Expand Down Expand Up @@ -223,7 +223,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
$databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection);
$databaseFixture =
new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(
new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(
dirname(__FILE__) . '/_files/initialUserFixture.xml'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
テストケースは
<classname>Zend_Test_PHPUnit_ControllerTestCase</classname>
を継承しなければなりません。このクラスは
<classname>PHPUnit_Framework_TestCase</classname> を継承しており、
<classname>PHPUnit\Framework\TestCase</classname> を継承しており、
PHPUnit が提供する仕組みやアサーションをすべて使用できます。
またそれに加えて、Zend Framework の
<acronym>MVC</acronym> 実装に特化した scaffold 機能やアサーションもあります。
Expand Down
18 changes: 3 additions & 15 deletions library/Zend/Test/PHPUnit/Constraint/DomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@
* @version $Id$
*/

if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) {
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php');
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php');

class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41
{}
} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) {
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery37.php');

class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery37
{}
} else {
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery34.php');

class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery34
{}
}
class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41
{}
Loading

0 comments on commit f069fbd

Please sign in to comment.