Skip to content

Commit

Permalink
Proceeding with the OS-specific (?) mystery
Browse files Browse the repository at this point in the history
  • Loading branch information
antecedent committed Aug 15, 2021
1 parent fbd81a1 commit da5a950
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/call-original.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require __DIR__ . "/includes/Inheritance.php";

p\replace("Singleton::getInstance", function() {
print("One\n");
assert(p\callOriginal() instanceof Singleton);
assert(p\relay() instanceof Singleton);
print("Two\n");
return "booyah";
});
Expand All @@ -28,7 +28,7 @@ foreach (range(1, 2) as $i) {

p\replace("identity", function($x) {
print("Four\n");
assert(p\callOriginal([42]) === 42);
assert(p\relay([42]) === 42);
print("Five\n");
return $x + 1;
});
Expand All @@ -37,14 +37,14 @@ assert(identity(15) === 16);

p\replace("TeenageSingletonChild::getInstance", function() {
print("Six\n");
assert(p\callOriginal() === "Y'ain't gettin' no instance from me");
assert(p\relay() === "Y'ain't gettin' no instance from me");
print("Seven\n");
});

TeenageSingletonChild::getInstance();

p\replace("FooObject::bah", function() {
return p\callOriginal() . " :)";
return p\relay() . " :)";
});

$foo = new FooObject;
Expand Down
2 changes: 1 addition & 1 deletion tests/closure-this.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $foo = new NamedObject("foo");

Patchwork\replace([$foo, "getName"], function() {
$this->name = "bar";
Patchwork\pass();
Patchwork\fallBack();
});

assert($foo->getName() === "bar");
Expand Down
2 changes: 1 addition & 1 deletion tests/multiple-patches.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Patchwork\replace("getInteger", function() {

Patchwork\replace("getInteger", function() {
print("Patch #3\n");
Patchwork\pass();
Patchwork\fallBack();
});

echo "Calling getInteger()\n";
Expand Down
2 changes: 1 addition & 1 deletion tests/no-result.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require __DIR__ . "/../Patchwork.php";
require __DIR__ . "/includes/Functions.php";

Patchwork\replace("getInteger", function() {
Patchwork\pass();
Patchwork\fallBack();
echo "This should not be printed\n";
});

Expand Down

0 comments on commit da5a950

Please sign in to comment.