Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contribution/generator/src/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public function createTestsFor(
$method = $this->builderFactory->method($methodName)
->makePublic()
->setReturnType('void')
->setDocComment("/**\n * uuid: {$case->uuid}\n * @testdox {$description}\n */")
->setDocComment("/** uuid: {$case->uuid} */")
->addAttribute(new Node\Attribute(
new Node\Name(\PHPUnit\Framework\Attributes\TestDox::class),
[new Node\Arg(new Node\Scalar\String_($description))],
))
->addStmt(
$this->builderFactory->funcCall(
'$this->markTestIncomplete',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<?php

class AnnalynsInfiltrationTest extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\TestDox;

class AnnalynsInfiltrationTest extends TestCase
{
public static function setUpBeforeClass(): void
{
require_once 'AnnalynsInfiltration.php';
}

/**
* @testdox cannot fast attack when the knight is awake
* @task_id 1
*/
#[TestDox('cannot fast attack when the knight is awake')]
public function testCannotFastAttackWhenKnightIsAwake()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -20,9 +23,9 @@ public function testCannotFastAttackWhenKnightIsAwake()
}

/**
* @testdox can fast attack when the knight is asleep
* @task_id 1
*/
#[TestDox('can fast attack when the knight is asleep')]
public function testCanFastAttackWhenKnightIsAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -32,9 +35,9 @@ public function testCanFastAttackWhenKnightIsAsleep()
}

/**
* @testdox cannot spy when everyone is asleep
* @task_id 2
*/
#[TestDox('cannot spy when everyone is asleep')]
public function testCannotSpyWhenEveryoneAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -48,9 +51,9 @@ public function testCannotSpyWhenEveryoneAsleep()
}

/**
* @testdox can spy when only the prisoner is awake
* @task_id 2
*/
#[TestDox('can spy when only the prisoner is awake')]
public function testCanSpyWhenOnlyPrisonerAwake()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -64,9 +67,9 @@ public function testCanSpyWhenOnlyPrisonerAwake()
}

/**
* @testdox can spy when only the archer is awake
* @task_id 2
*/
#[TestDox('can spy when only the archer is awake')]
public function testCanSpyWhenOnlyArcherAwake()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -80,9 +83,9 @@ public function testCanSpyWhenOnlyArcherAwake()
}

/**
* @testdox can spy when only the knight is awake
* @task_id 2
*/
#[TestDox('can spy when only the knight is awake')]
public function testCanSpyWhenOnlyKnightAwake()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -96,9 +99,9 @@ public function testCanSpyWhenOnlyKnightAwake()
}

/**
* @testdox can spy when only the knight is asleep
* @task_id 2
*/
#[TestDox('can spy when only the knight is asleep')]
public function testCanSpyWhenOnlyKnightAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -112,9 +115,9 @@ public function testCanSpyWhenOnlyKnightAsleep()
}

/**
* @testdox can spy when only the prisoner is asleep
* @task_id 2
*/
#[TestDox('can spy when only the prisoner is asleep')]
public function testCanSpyWhenOnlyPrisonerAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -128,9 +131,9 @@ public function testCanSpyWhenOnlyPrisonerAsleep()
}

/**
* @testdox can spy when only the archer is asleep
* @task_id 2
*/
#[TestDox('can spy when only the archer is asleep')]
public function testCanSpyWhenOnlyArcherAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -144,9 +147,9 @@ public function testCanSpyWhenOnlyArcherAsleep()
}

/**
* @testdox can spy when everyone is awake
* @task_id 2
*/
#[TestDox('can spy when everyone is awake')]
public function testCanSpyWhenEveryoneAwake()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -160,9 +163,9 @@ public function testCanSpyWhenEveryoneAwake()
}

/**
* @testdox cannot signal the prisoner when everyone is asleep
* @task_id 3
*/
#[TestDox('cannot signal the prisoner when everyone is asleep')]
public function testCannotSignalWhenAllAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -175,9 +178,9 @@ public function testCannotSignalWhenAllAsleep()
}

/**
* @testdox can signal the prisoner when archer is asleep
* @task_id 3
*/
#[TestDox('can signal the prisoner when archer is asleep')]
public function testCanSignalWhenArcherAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -190,9 +193,9 @@ public function testCanSignalWhenArcherAsleep()
}

/**
* @testdox cannot signal the prisoner when prisoner is asleep
* @task_id 3
*/
#[TestDox('cannot signal the prisoner when prisoner is asleep')]
public function testCannotSignalWhenPrisonerAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -205,9 +208,9 @@ public function testCannotSignalWhenPrisonerAsleep()
}

/**
* @testdox cannot signal the prisoner when no one is asleep
* @task_id 3
*/
#[TestDox('cannot signal the prisoner when no one is asleep')]
public function testCannotSignalWhenNoOneAsleep()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -220,9 +223,9 @@ public function testCannotSignalWhenNoOneAsleep()
}

/**
* @testdox can liberate the prisoner when no one is awake but dog present
* @task_id 4
*/
#[TestDox('can liberate the prisoner when no one is awake but dog present')]
public function testCanLiberateWhenAllAsleepAndDogPresent()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -237,9 +240,9 @@ public function testCanLiberateWhenAllAsleepAndDogPresent()
}

/**
* @testdox can liberate the prisoner when prisoner is awake with dog
* @task_id 4
*/
#[TestDox('can liberate the prisoner when prisoner is awake with dog')]
public function testCanLiberateWhenPrisonerAwakeWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -254,9 +257,9 @@ public function testCanLiberateWhenPrisonerAwakeWithDog()
}

/**
* @testdox cannot liberate the prisoner when archer is awake with dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when archer is awake with dog')]
public function testCannotLiberateWhenArcherAwakeWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -271,9 +274,9 @@ public function testCannotLiberateWhenArcherAwakeWithDog()
}

/**
* @testdox can liberate the prisoner when only knight awake with dog
* @task_id 4
*/
#[TestDox('can liberate the prisoner when only knight awake with dog')]
public function testCanLiberateWhenKnightAwakeWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -288,9 +291,9 @@ public function testCanLiberateWhenKnightAwakeWithDog()
}

/**
* @testdox cannot liberate the prisoner when prisoner asleep with dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when prisoner asleep with dog')]
public function testCannotLiberateWhenPrisonerAsleepWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -305,9 +308,9 @@ public function testCannotLiberateWhenPrisonerAsleepWithDog()
}

/**
* @testdox can liberate the prisoner when only archer asleep with dog
* @task_id 4
*/
#[TestDox('can liberate the prisoner when only archer asleep with dog')]
public function testCanLiberateWhenArcherAsleepWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -322,9 +325,9 @@ public function testCanLiberateWhenArcherAsleepWithDog()
}

/**
* @testdox cannot liberate the prisoner when knight asleep with dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when knight asleep with dog')]
public function testCannotLiberateWhenKnightAsleepWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -339,9 +342,9 @@ public function testCannotLiberateWhenKnightAsleepWithDog()
}

/**
* @testdox cannot liberate the prisoner when all awake with dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when all awake with dog')]
public function testCannotLiberateWhenAllAwakeWithDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -356,9 +359,9 @@ public function testCannotLiberateWhenAllAwakeWithDog()
}

/**
* @testdox cannot liberate the prisoner when no one is awake and no dog present
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when no one is awake and no dog present')]
public function testCannotLiberateWhenAllAsleepAndNoDogPresent()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -373,9 +376,9 @@ public function testCannotLiberateWhenAllAsleepAndNoDogPresent()
}

/**
* @testdox can liberate the prisoner when prisoner is awake without dog
* @task_id 4
*/
#[TestDox('can liberate the prisoner when prisoner is awake without dog')]
public function testCanLiberateWhenPrisonerAwakeWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -390,9 +393,9 @@ public function testCanLiberateWhenPrisonerAwakeWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when archer is awake without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when archer is awake without dog')]
public function testCannotLiberateWhenArcherAwakeWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -407,9 +410,9 @@ public function testCannotLiberateWhenArcherAwakeWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when only knight awake without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when only knight awake without dog')]
public function testCannotLiberateWhenKnightAwakeWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -424,9 +427,9 @@ public function testCannotLiberateWhenKnightAwakeWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when prisoner asleep without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when prisoner asleep without dog')]
public function testCannotLiberateWhenPrisonerAsleepWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -441,9 +444,9 @@ public function testCannotLiberateWhenPrisonerAsleepWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when only archer asleep without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when only archer asleep without dog')]
public function testCannotLiberateWhenArcherAsleepWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -458,9 +461,9 @@ public function testCannotLiberateWhenArcherAsleepWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when knight asleep without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when knight asleep without dog')]
public function testCannotLiberateWhenKnightAsleepWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand All @@ -475,9 +478,9 @@ public function testCannotLiberateWhenKnightAsleepWithoutDog()
}

/**
* @testdox cannot liberate the prisoner when all awake without dog
* @task_id 4
*/
#[TestDox('cannot liberate the prisoner when all awake without dog')]
public function testCannotLiberateWhenAllAwakeWithoutDog()
{
$infiltration = new AnnalynsInfiltration();
Expand Down
11 changes: 6 additions & 5 deletions exercises/concept/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ PHP_STUB
cat <<- PHP_STUB >> "${base_dir}/${test_file}"
<?php

class ${new_classname}Test extends PHPUnit\Framework\TestCase
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\TestDox;

class ${new_classname}Test extends TestCase
{
public static function setUpBeforeClass(): void
{
require_once '${new_classname}.php';
}

/**
* @testdox some test stub
* @task_id 1
*/
/** @task_id 1 */
#[TestDox('some test stub')]
public function testStub()
{
\$class = new ${new_classname}();
Expand Down
Loading