Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/amp v3 support #108

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 17 additions & 11 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ on:
branches: [ main ]

jobs:
build-test:
unit-test:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Composer 8
uses: php-actions/composer@v5
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php_version: 8.2
- name: PHP 8 tests
uses: php-actions/phpunit@v2
with:
version: 9
php_version: 8.2
memory_limit: 1G
php-version: 8.2
extensions: xdebug
tools: composer:2
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Composer (AsyncUnit & Tools)
run: composer install
- name: Unit Testing
env:
XDEBUG_MODE: coverage
run: ./vendor/bin/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Acme\DemoSuites\ErrorConditions\AfterAllAttributeOnNotTestCaseOrTestSuite;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;

class BadTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Acme\DemoSuites\ErrorConditions\AfterAllNonStaticMethod;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class BadTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\AfterEachAttributeOnNotTestCaseOrTestSuite;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Cspray\Labrador\AsyncUnit\Attribute\AfterEach;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\Attribute\AfterEach;

class BadTestCase {

Expand Down
4 changes: 2 additions & 2 deletions acme_src/ErrorConditions/BadNamespaceTest/MyTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTest\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class MyTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseAfterAll\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\TestCase;

class MyTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseAfterEach\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\AfterEach;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\AfterEach;
use Labrador\AsyncUnit\Framework\TestCase;

class MyTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseBeforeAll\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\BeforeAll;
use Labrador\AsyncUnit\Framework\TestCase;

class MyTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseBeforeEach\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\BeforeEach;
use Labrador\AsyncUnit\Framework\TestCase;

class MyTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterAll\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterEach\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\AfterEach;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\AfterEach;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterEachTest\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeAll\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\BeforeAll;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeEach\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\BeforeEach;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeEachTest\IntentionallyBad;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest;
use Labrador\AsyncUnit\Framework\TestSuite;

class MyTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Acme\DemoSuites\ErrorConditions\BeforeAllAttributeOnNotTestCaseOrTestSuite;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll;
use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Labrador\AsyncUnit\Framework\Attribute\BeforeAll;
use Labrador\AsyncUnit\Framework\Attribute\Test;

class BadTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Acme\DemoSuites\ErrorConditions\BeforeAllNonStaticMethod;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll;
use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\BeforeAll;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class BadTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Acme\DemoSuites\ErrorConditions\BeforeEachAttributeOnNotTestCaseOrTestSuite;

use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll;
use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach;
use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Labrador\AsyncUnit\Framework\Attribute\BeforeAll;
use Labrador\AsyncUnit\Framework\Attribute\BeforeEach;
use Labrador\AsyncUnit\Framework\Attribute\Test;

class BadTestCase {

Expand Down
2 changes: 1 addition & 1 deletion acme_src/ErrorConditions/NoTestsTestCase/BadTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Acme\DemoSuites\ErrorConditions\NoTestsTestCase;

use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\TestCase;

class BadTestCase extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Acme\DemoSuites\ErrorConditions\TestAttributeOnNotTestCase;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Labrador\AsyncUnit\Framework\Attribute\Test;

class BadTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class FirstTestCase extends TestCase {

#[Test]
public function ensureSuiteCounter() : void {
$this->assert()->intEquals(0, $this->testSuite()->getCounter());
$this->assert->intEquals(0, $this->testSuite->getCounter());
}

#[Test]
public function ensureSuiteCounterAgain() : void {
$this->assert()->intEquals(0, $this->testSuite()->getCounter());
$this->assert->intEquals(0, $this->testSuite->getCounter());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\AfterAll;
use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\AfterAll;
use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite;
use Labrador\AsyncUnit\Framework\TestSuite;

#[DefaultTestSuite]
class MyTestSuite extends TestSuite {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class SecondTestCase extends TestCase {

#[Test]
public function ensureSuiteCounter() : void {
$this->assert()->intEquals(0, $this->testSuite()->getCounter());
$this->assert->intEquals(0, $this->testSuite->getCounter());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class FirstTestCase extends TestCase {

#[Test]
public function testSomething() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

#[Test]
public function testSomethingElse() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

#[Test]
public function testItAgain() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\AfterEach;
use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite;
use Cspray\Labrador\AsyncUnit\TestSuite;
use Labrador\AsyncUnit\Framework\Attribute\AfterEach;
use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite;
use Labrador\AsyncUnit\Framework\TestSuite;

#[DefaultTestSuite]
class MyTestSuite extends TestSuite {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class SecondTestCase extends TestCase {

#[Test]
public function ensureIntEquals() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook;

use Cspray\Labrador\AsyncUnit\Attribute\Test;
use Cspray\Labrador\AsyncUnit\TestCase;
use Labrador\AsyncUnit\Framework\Attribute\Test;
use Labrador\AsyncUnit\Framework\TestCase;

class ThirdTestCase extends TestCase {

#[Test]
public function testFoo() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

#[Test]
public function testBar() : void {
$this->assert()->arrayEquals([], $this->testSuite()->getState());
$this->assert->arrayEquals([], $this->testSuite->getState());
}

}
Loading
Loading