Skip to content

Commit

Permalink
Use PHPUnit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Aug 21, 2019
1 parent f661917 commit 950cff1
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

PACKAGE_NAME = ICanBoogie/DateTime
PACKAGE_VERSION = v1.2
PHPUNIT_VERSION = phpunit-5.7.phar
PHPUNIT_FILENAME = build/$(PHPUNIT_VERSION)
PHPUNIT = php $(PHPUNIT_FILENAME)

# do not edit the following lines

all: $(PHPUNIT_FILENAME) vendor

usage:
@echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files."

Expand All @@ -17,17 +22,23 @@ update:
autoload: vendor
@composer dump-autoload

test: vendor
@phpunit
test-dependencies: $(PHPUNIT_FILENAME) vendor

$(PHPUNIT_FILENAME):
mkdir -p build
wget https://phar.phpunit.de/$(PHPUNIT_VERSION) -O $(PHPUNIT_FILENAME)

test-coverage: vendor
test: test-dependencies
@$(PHPUNIT)

test-coverage: test-dependencies
@mkdir -p build/coverage
@phpunit --coverage-html build/coverage
@$(PHPUNIT) --coverage-html build/coverage

test-coveralls: vendor
test-coveralls: test-dependencies
@mkdir -p build/logs
composer require --dev php-coveralls/php-coveralls
@phpunit --coverage-clover build/logs/clover.xml
@$(PHPUNIT) --coverage-clover build/logs/clover.xml
php vendor/bin/php-coveralls -v

doc: vendor
Expand All @@ -42,3 +53,5 @@ clean:
@rm -fR build
@rm -fR vendor
@rm -f composer.lock

.PHONY: all autoload doc clean test test-coverage test-coveralls update
26 changes: 11 additions & 15 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="./vendor/autoload.php"
>
<testsuites>
<testsuite name="ICanBoogie/DateTime Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="ICanBoogie/DateTime">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
Expand Down
5 changes: 3 additions & 2 deletions tests/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
* file that was distributed with this source code.
*/

namespace Tests\ICanBoogie\Time;
namespace Tests\ICanBoogie;

use ICanBoogie\DateTime;
use ICanBoogie\DateTimeTest\MyDateTime;
use PHPUnit\Framework\TestCase;

class DateTimeTest extends \PHPUnit_Framework_TestCase
class DateTimeTest extends TestCase
{
public function setUp()
{
Expand Down
5 changes: 3 additions & 2 deletions tests/TimeZoneLocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
* file that was distributed with this source code.
*/

namespace Tests\ICanBoogie\Time;
namespace Tests\ICanBoogie;

use ICanBoogie\TimeZoneLocation;
use PHPUnit\Framework\TestCase;

class TimeZoneLocationTest extends \PHPUnit_Framework_TestCase
class TimeZoneLocationTest extends TestCase
{
public function test_from()
{
Expand Down
5 changes: 3 additions & 2 deletions tests/TimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
* file that was distributed with this source code.
*/

namespace Tests\ICanBoogie\Time;
namespace Tests\ICanBoogie;

use ICanBoogie\TimeZone;
use PHPUnit\Framework\TestCase;

class TimeZoneTest extends \PHPUnit_Framework_TestCase
class TimeZoneTest extends TestCase
{
public function test_get_location()
{
Expand Down
12 changes: 0 additions & 12 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit 950cff1

Please sign in to comment.