Skip to content

Commit

Permalink
Merge pull request #19 from SimonFrings/tests
Browse files Browse the repository at this point in the history
Clean up test suite and add .gitattributes to exclude dev files from exports
  • Loading branch information
clue authored May 12, 2020
2 parents 119d8b5 + 864321d commit c118bc3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/examples/ export-ignore
/phpunit.xml.dist export-ignore
/tests/ export-ignore
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"autoload": {
"psr-4": { "Clue\\React\\NDJson\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Clue\\Tests\\React\\NDJson\\": "tests/" }
},
"require": {
"php": ">=5.3",
"react/stream": "^1.0 || ^0.7 || ^0.6"
Expand Down
4 changes: 1 addition & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php"
colors="true"
>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="NDJSON test suite">
<directory>./tests/</directory>
Expand Down
2 changes: 2 additions & 0 deletions tests/DecoderTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\NDJson;

use Clue\React\NDJson\Decoder;
use React\Stream\ThroughStream;

Expand Down
2 changes: 2 additions & 0 deletions tests/EncoderTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\NDJson;

use React\Stream\WritableResourceStream;
use Clue\React\NDJson\Encoder;

Expand Down
6 changes: 2 additions & 4 deletions tests/bootstrap.php → tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php

use PHPUnit\Framework\TestCase as BaseTestCase;

require_once __DIR__ . '/../vendor/autoload.php';
namespace Clue\Tests\React\NDJson;

error_reporting(-1);
use PHPUnit\Framework\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
{
Expand Down

0 comments on commit c118bc3

Please sign in to comment.