-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added phpunit code coverage support.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="tests/bootstrap.php" colors="true"> | ||
<php> | ||
<!-- Set error reporting to E_ALL. --> | ||
<ini name="error_reporting" value="32767"/> | ||
<!-- Do not limit the amount of memory tests take to run. --> | ||
<ini name="memory_limit" value="-1"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="Addressfield lookup Unit Test Suite"> | ||
<directory>./tests/src/Unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<listeners> | ||
<listener class="\Drupal\Tests\Listeners\DrupalListener"> | ||
</listener> | ||
</listeners> | ||
<!-- Filter for coverage reports. --> | ||
<filter> | ||
<whitelist> | ||
<directory>./src</directory> | ||
<!-- By definition test classes have no tests. --> | ||
<exclude> | ||
<directory suffix="Test.php">./</directory> | ||
<directory suffix="TestBase.php">./</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="coverage-html" target="coverage" showUncoveredFiles="true"/> | ||
</logging> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Searches for the core bootstrap file. | ||
*/ | ||
|
||
$dir = __DIR__; | ||
|
||
// Match against previous dir for Windows. | ||
$previous_dir = ''; | ||
|
||
while ($dir = dirname($dir)) { | ||
// We've reached the root. | ||
if ($dir === $previous_dir) { | ||
break; | ||
} | ||
|
||
$previous_dir = $dir; | ||
|
||
if (is_file($dir . '/core/tests/bootstrap.php')) { | ||
require_once $dir . '/core/tests/bootstrap.php'; | ||
return; | ||
} | ||
} | ||
|
||
throw new RuntimeException('Unable to load core bootstrap.php.'); |