Skip to content

Commit 05632cb

Browse files
[tests] Use @requires annotation when possible
1 parent c9d3282 commit 05632cb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Test/DoctrineTestHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class DoctrineTestHelper
2929
*/
3030
public static function createTestEntityManager()
3131
{
32-
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
33-
\PHPUnit_Framework_TestCase::markTestSkipped('This test requires SQLite support in your environment');
32+
if (!extension_loaded('pdo_sqlite')) {
33+
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
3434
}
3535

3636
$config = new \Doctrine\ORM\Configuration();

Tests/Logger/DbalLoggerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,11 @@ public function testLogLongString()
132132
));
133133
}
134134

135+
/**
136+
* @requires extension mbstring
137+
*/
135138
public function testLogUTF8LongString()
136139
{
137-
if (!function_exists('mb_detect_encoding')) {
138-
$this->markTestSkipped('Testing log shortening of utf8 charsets requires the mb_detect_encoding() function.');
139-
}
140-
141140
$logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
142141

143142
$dbalLogger = $this

0 commit comments

Comments
 (0)