Skip to content

Commit 5ef1be0

Browse files
authored
Merge pull request #148 from TomzxForks/features/refactor-tests-to-namespace
Move tests to the Fhaculty\Graph\Tests namespace
2 parents 6c82f44 + aa3d5be commit 5ef1be0

19 files changed

Lines changed: 61 additions & 8 deletions

composer.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@
22
"name": "clue/graph",
33
"type": "library",
44
"description": "A mathematical graph/network library written in PHP",
5-
"keywords": ["graph", "network", "mathematical", "vertex", "edge"],
5+
"keywords": [
6+
"graph",
7+
"network",
8+
"mathematical",
9+
"vertex",
10+
"edge"
11+
],
612
"homepage": "https://github.com/clue/graph",
713
"license": "MIT",
814
"autoload": {
9-
"psr-4": {"Fhaculty\\Graph\\": "src/"}
15+
"psr-4": {
16+
"Fhaculty\\Graph\\": "src/"
17+
}
18+
},
19+
"autoload-dev": {
20+
"psr-4": {
21+
"Fhaculty\\Graph\\Tests\\": "tests/"
22+
}
1023
},
1124
"require": {
1225
"php": "^7.0 || ^5.3"

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="tests/bootstrap.php"
3+
<phpunit bootstrap="vendor/autoload.php"
44
colors="true" convertErrorsToExceptions="true"
55
convertNoticesToExceptions="true"
66
convertWarningsToExceptions="true"
@@ -15,4 +15,4 @@
1515
<directory>./src/</directory>
1616
</whitelist>
1717
</filter>
18-
</phpunit>
18+
</phpunit>

tests/Attribute/AbstractAttributeAwareTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Attribute;
4+
35
use Fhaculty\Graph\Attribute\AttributeAware;
6+
use Fhaculty\Graph\Tests\TestCase;
7+
48
abstract class AbstractAttributeAwareTest extends TestCase
59
{
610
abstract protected function createAttributeAware();

tests/Attribute/AttributeBagContainerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Attribute;
4+
35
use Fhaculty\Graph\Attribute\AttributeBagContainer;
46

57
class AttributeBagContainerTest extends AbstractAttributeAwareTest

tests/Attribute/AttributeBagNamespacedTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Attribute;
4+
35
use Fhaculty\Graph\Graph;
46
use Fhaculty\Graph\Attribute\AttributeBagNamespaced;
57
use Fhaculty\Graph\Attribute\AttributeAware;

tests/Attribute/AttributeBagReferenceTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Attribute;
4+
35
use Fhaculty\Graph\Attribute\AttributeBagReference;
46

57
class AttributeBagReferenceTest extends AbstractAttributeAwareTest

tests/Edge/EdgeAttributesTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Edge;
4+
35
use Fhaculty\Graph\Graph;
46
use Fhaculty\Graph\Edge\Base as Edge;
7+
use Fhaculty\Graph\Tests\TestCase;
58

69
class EdgeAttributesTest extends TestCase
710
{
8-
911
/**
1012
*
1113
* @var Edge

tests/Edge/EdgeBaseTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Edge;
4+
35
use Fhaculty\Graph\Graph;
46
use Fhaculty\Graph\Edge\Base as Edge;
7+
use Fhaculty\Graph\Tests\Attribute\AbstractAttributeAwareTest;
58

69
abstract class EdgeBaseTest extends AbstractAttributeAwareTest
710
{
8-
911
protected $graph;
1012
protected $v1;
1113
protected $v2;

tests/Edge/EdgeDirectedTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Edge;
4+
35
class EdgeDirectedTest extends EdgeBaseTest
46
{
57
protected function createEdge()

tests/Edge/EdgeUndirectedTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Fhaculty\Graph\Tests\Edge;
4+
35
class EdgeUndirectedTest extends EdgeBaseTest
46
{
57
protected function createEdge()

0 commit comments

Comments
 (0)