Skip to content

Commit

Permalink
Merge pull request #862 from sjinks/tests
Browse files Browse the repository at this point in the history
Use markTestSkipped() instead of echo
  • Loading branch information
Phalcon committed Jul 17, 2013
2 parents d551b09 + f64ffe5 commit 76e5a80
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 72 deletions.
2 changes: 1 addition & 1 deletion unit-tests/CacheResultsetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function testCacheResultsetSimpleNoComplex()
public function testCacheResultsetSimpleMemcached()
{
if (!class_exists('Memcache')) {
echo "Memcache class does not exist, test skipped\n";
$this->markTestSkipped("Memcache class does not exist, test skipped");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion unit-tests/CollectionsEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function collectionsAutoloader($className)
public function testCollectionsEvents()
{
if (!class_exists('Mongo')) {
echo "Mongo class does not exist, test skipped\n";
$this->markTestSkipped("Mongo class does not exist, test skipped");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion unit-tests/CollectionsSerializeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function collectionsAutoloader($className)
public function testCollectionsEvents()
{
if (!class_exists('Mongo')) {
echo "Mongo class does not exist, test skipped\n";
$this->markTestSkipped("Mongo class does not exist, test skipped");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion unit-tests/CollectionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function collectionsAutoloader($className)
public function testCollections()
{
if (!class_exists('Mongo')) {
echo "Mongo class does not exist, test skipped\n";
$this->markTestSkipped("Mongo class does not exist, test skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/DbBindTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testDbBindMysql()

require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -46,7 +46,7 @@ public function testDbBindPostgresql()

require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -62,7 +62,7 @@ public function testDbBindSqlite()

require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/DbDescribeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function testDbMysql()

require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down Expand Up @@ -616,7 +616,7 @@ public function testDbPostgresql()

require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down Expand Up @@ -709,7 +709,7 @@ public function testDbSqlite()

require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/DbProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testDbMysql()

require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -87,7 +87,7 @@ public function testDbPostgresql()

require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -101,7 +101,7 @@ public function testDbSqlite()

require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
12 changes: 6 additions & 6 deletions unit-tests/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDbMysql()
$this->_executeTests($connection);
}
else {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
}
}

Expand All @@ -44,15 +44,15 @@ public function testDbPostgresql()
$this->_executeTests($connection);
}
else {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
}
}

public function testDbPostgresqlSchemas()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public function testDbSqlite()
$this->_executeTests($connection);
}
else {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
}

}
Expand Down Expand Up @@ -246,7 +246,7 @@ protected function _executeTests($connection)

//Transactions without savepoints.
$connection->setNestedTransactionsWithSavepoints(false);

$success = $connection->begin(); // level 1 - real
$this->assertTrue($success);

Expand Down Expand Up @@ -308,7 +308,7 @@ protected function _executeTests($connection)
$this->assertTrue($success);

$success = $connection->rollback(); // rollback - real rollback
$this->assertTrue($success);
$this->assertTrue($success);
}

}
6 changes: 3 additions & 3 deletions unit-tests/ModelsCalculationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testCalculationsMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -80,7 +80,7 @@ public function testCalculationsPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -100,7 +100,7 @@ public function testCalculationsSqlite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsCriteriaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testModelsMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -80,7 +80,7 @@ public function testModelsPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -100,7 +100,7 @@ public function testModelsSQLite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsForeignKeysTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testForeignKeysMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -79,7 +79,7 @@ public function testForeignKeysPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -98,7 +98,7 @@ public function testForeignKeysSqlite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsHydrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testModelsMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -80,7 +80,7 @@ public function testModelsPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -100,7 +100,7 @@ public function testModelsSQLite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testMetadataMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -77,7 +77,7 @@ public function testMetadataPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -95,7 +95,7 @@ public function testMetadataSqlite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsQueryExecuteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testExecuteMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -90,7 +90,7 @@ public function testExecutePostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -116,7 +116,7 @@ public function testExecuteSqlite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ModelsRelationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testModelsMysql()
{
require 'unit-tests/config.db.php';
if (empty($configMysql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -81,7 +81,7 @@ public function testModelsPostgresql()
{
require 'unit-tests/config.db.php';
if (empty($configPostgresql)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand All @@ -101,7 +101,7 @@ public function testModelsSqlite()
{
require 'unit-tests/config.db.php';
if (empty($configSqlite)) {
echo "Skipped\n";
$this->markTestSkipped("Skipped");
return;
}

Expand Down
Loading

0 comments on commit 76e5a80

Please sign in to comment.