Skip to content

Commit

Permalink
Migrate to new testing library
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 10, 2024
1 parent 98c4847 commit f1e1bb8
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
echo "vendor/autoload.php" > composer.pth
- name: Run test suite
run: sh xp-run xp.unittest.TestRunner src/test/php
run: sh xp-run xp.test.Runner -r Dots src/test/php
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Commands ChangeLog

## ?.?.? / ????-??-??

* Implemented xp-framework/rfc#344: New testing library - @thekid
* Added PHP 8.2, 8.3 and 8.4 to the test matrix - @thekid

## 11.0.0 / 2021-10-21
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"php" : ">=7.0.0"
},
"require-dev" : {
"xp-framework/unittest": "^11.0 | ^10.0"
"xp-framework/test": "^1.0"
},
"bin": ["bin/xp.xp-framework.command.cmd"],
"autoload" : {
Expand Down
3 changes: 1 addition & 2 deletions src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php namespace util\cmd\unittest;

use io\streams\{MemoryInputStream, MemoryOutputStream};
use unittest\Assert;
use unittest\{Arg, Args, Test, TestCase};
use test\{Assert, Before, Test};
use util\cmd\{Command, Config, ParamString};
use xp\command\CmdRunner;

Expand Down
4 changes: 2 additions & 2 deletions src/test/php/util/cmd/unittest/CmdRunnerTest.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace util\cmd\unittest;

use unittest\Assert;
use unittest\{Test, Values};
use test\Assert;
use test\{Test, Values};
use xp\command\CmdRunner;

class CmdRunnerTest extends AbstractRunnerTest {
Expand Down
6 changes: 3 additions & 3 deletions src/test/php/util/cmd/unittest/CommandsTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use lang\reflect\Package;
use lang\{ClassLoader, ClassNotFoundException, IllegalArgumentException};
use unittest\{Assert, Before, Expect, Test, Values};
use test\{Assert, Before, Expect, Test, Values};
use util\cmd\{Command, Commands};

class CommandsTest {
Expand Down Expand Up @@ -62,12 +62,12 @@ public function named_non_existant($name) {
Commands::named($name);
}

#[Test, Expect(['class' => IllegalArgumentException::class, 'withMessage' => '/CommandsTest is not runnable/'])]
#[Test, Expect(class: IllegalArgumentException::class, message: '/CommandsTest is not runnable/')]
public function name_non_runnable() {
Commands::named(nameof($this));
}

#[Test, Expect(['class' => IllegalArgumentException::class, 'withMessage' => '/CommandsTest is not runnable/'])]
#[Test, Expect(class: IllegalArgumentException::class, message: '/CommandsTest is not runnable/')]
public function file_not_runnable() {
Commands::named(__FILE__);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/util/cmd/unittest/ConfigTest.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace util\cmd\unittest;

use lang\ElementNotFoundException;
use unittest\Assert;
use unittest\{Expect, Test};
use test\Assert;
use test\{Expect, Test};
use util\cmd\Config;
use util\{ClassPathPropertySource, FilesystemPropertySource, PropertyAccess};

Expand Down
4 changes: 2 additions & 2 deletions src/test/php/util/cmd/unittest/ParamStringTest.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace util\cmd\unittest;

use lang\IllegalArgumentException;
use unittest\Assert;
use unittest\{Expect, Test};
use test\Assert;
use test\{Expect, Test};
use util\cmd\ParamString;

class ParamStringTest {
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/util/cmd/unittest/RunnerTest.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace util\cmd\unittest;

use unittest\Assert;
use unittest\{Arg, Test, Values};
use test\Assert;
use test\{Arg, Test, Values};
use util\cmd\Command;
use xp\command\Runner;

Expand Down

0 comments on commit f1e1bb8

Please sign in to comment.