Skip to content

Commit f357c23

Browse files
committed
Updated dependencies + tests
1 parent efeb957 commit f357c23

File tree

6 files changed

+26
-22
lines changed

6 files changed

+26
-22
lines changed

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
{
2+
"type": "pre-macro",
23
"name": "pre/deferred",
34
"license": "MIT",
45
"require": {
5-
"pre/plugin": "^0.6"
6+
"pre/plugin": "^0.7.3"
67
},
78
"autoload": {
8-
"files": [
9-
"src/bootstrap.php"
10-
],
119
"psr-4": {
1210
"Pre\\Deferred\\": "src"
1311
}
1412
},
1513
"require-dev": {
16-
"phpunit/phpunit": "^5.0"
14+
"phpunit/phpunit": "^5.0|^6.0"
1715
},
1816
"autoload-dev": {
1917
"psr-4": {
2018
"Pre\\Deferred\\": "tests"
2119
}
20+
},
21+
"extra": {
22+
"macros": [
23+
"src/macros.yay"
24+
]
2225
}
2326
}

src/bootstrap.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/macros.pre renamed to src/macros.yay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ macro ·recursion {
3131
$context = func_get_args();
3232

3333
return function() use ($context) {
34-
call_user_func_array((·function), $context);
34+
call_user_func_array(··stringify(·function), $context);
3535
};
3636
}, ·parameters));
3737
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Pre\Deferred;
44

5-
use Pre\Testing\Runner;
5+
use Pre\Plugin\Testing\Runner;
66

7-
class SpecTest extends Runner
7+
class MacroTest extends Runner
88
{
99
protected function path(): string
1010
{

tests/bootstrap.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22

3-
namespace Yay;
3+
namespace
4+
{
5+
require __DIR__ . "/../vendor/autoload.php";
46

5-
// let's use a namespace trick, to make non-colliding variables predictable.
7+
putenv("PRE_BASE_DIR=" . __DIR__ . "/../");
68

7-
function md5($value)
8-
{
9-
return $value;
9+
Pre\Plugin\addMacroPath(__DIR__ . "/../src/macros.yay");
1010
}
1111

12-
putenv("PRE_BASE_DIR=" . __DIR__ . "/..");
13-
14-
require __DIR__ . "/../vendor/autoload.php";
12+
namespace Yay
13+
{
14+
function md5($value)
15+
{
16+
return $value;
17+
}
18+
}

tests/specs/deferred.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ $deferred·0 = new \Pre\Deferred\Deferred(call_user_func(function () {
2121
};
2222
}, "path/to/file"));
2323

24-
$deferred·2 = new \Pre\Deferred\Deferred(call_user_func(function ($context·2) {
25-
return function () use ($context·2) {
26-
extract($context·2);
24+
$deferred·1 = new \Pre\Deferred\Deferred(call_user_func(function ($context·1) {
25+
return function () use ($context·1) {
26+
extract($context·1);
2727
fclose($handle);
2828
print "all done";
2929
};

0 commit comments

Comments
 (0)