Skip to content

Commit 7e6d8ab

Browse files
committed
include import
1 parent 9a1eeea commit 7e6d8ab

File tree

7 files changed

+11
-17
lines changed

7 files changed

+11
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"php": ">=5.4"
1717
},
1818
"autoload": {
19-
"psr-0": { "Brianium": ["src/", "test/"] }
19+
"files": ["src/Brianium/Phunc/import.php"]
2020
}
2121
}

src/Brianium/Phunc/Functions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
namespace Brianium\Phunc\Functions;
3-
require_once __DIR__ . DIRECTORY_SEPARATOR . 'Arrays.php';
43

54
use Brianium\Phunc\Arrays as _array;
65

@@ -124,4 +123,4 @@ function compose(/** functions */) {
124123
$result = [call_user_func_array($fn, $result)];
125124
return $result[0];
126125
};
127-
}
126+
}

src/Brianium/Phunc/import.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
if (!defined('DS')) {
3+
define('DS', DIRECTORY_SEPARATOR);
4+
}
5+
require_once __DIR__ . DS . 'Functions.php';
6+
require_once __DIR__ . DS . 'Arrays.php';

test/Brianium/Phunc/Functions/ComposeTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
namespace Brianium\Phunc\Functions;
3-
loadModule('Functions');
43

54
class ComposeTest extends \PHPUnit_Framework_TestCase
65
{
@@ -14,4 +13,4 @@ public function test_compose_passes_results_from_end_to_first()
1413
$result = $findNameAndMakeItCool($subject);
1514
$this->assertEquals('Brian is cool.', $result);
1615
}
17-
}
16+
}

test/Brianium/Phunc/Functions/CurryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
namespace Brianium\Phunc\Functions;
3-
loadModule('Functions');
43

54
class CurryTest extends \PHPUnit_Framework_TestCase
65
{
@@ -65,4 +64,4 @@ public function test_curryRight_function_with_arity_arg()
6564
$this->assertEquals('brian', $strstrBeforeNeedle($subject, ':'));
6665
$this->assertEquals('456', $arrayToString($testValues));
6766
}
68-
}
67+
}

test/Brianium/Phunc/Functions/PartialTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?php
22
namespace Brianium\Phunc\Functions;
33

4-
/**
5-
* Require the functions module
6-
*/
7-
loadModule('Functions');
8-
94
class PartialTest extends \PHPUnit_Framework_TestCase
105
{
116
protected $testValue = 'test';
@@ -89,4 +84,4 @@ public function sayHello($name)
8984
{
9085
return 'hello!' . $name;
9186
}
92-
}
87+
}

test/bootstrap.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@
88

99
define('SRC', dirname(__DIR__) . DS . 'src');
1010

11-
function loadModule($name) {
12-
$path = SRC . DS . 'Brianium' . DS . 'Phunc' . DS . "$name.php";
13-
require_once $path;
14-
}

0 commit comments

Comments
 (0)