Skip to content
Open
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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ traits for reuse.
- Test layout generally mirrors `src/` under `tests/`.
- Test classes extend `Elastica\Test\Base` (directly or via a shared base such
as `BaseAggregationTestCase`) and live in `Elastica\Test`.
`ClientConfigurationTest` and `JSONTest` extend `TestCase` directly and so
skip the group check below. Don't copy them.
`ClientConfigurationTest` extends `TestCase` directly and so skips the group
check in `Base::setUp`. It declares its group explicitly; don't copy it.
- Method names start with `test`.
- Declare one group per test via the PHPUnit attribute `#[Group('unit')]`,
`#[Group('functional')]`, or `#[Group('benchmark')]`. `Base::setUp` fails any
Expand Down
7 changes: 4 additions & 3 deletions tests/JSONTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Elastica\Test;

use Elastica\JSON;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\Group;

/**
* JSONTest.
Expand All @@ -14,12 +14,13 @@
*
* @internal
*/
class JSONTest extends TestCase
#[Group('unit')]
class JSONTest extends Base
{
public function testStringifyMustNotThrowExceptionOnValid(): void
{
$value = JSON::stringify([]);
$this->assertEmpty($value);
$this->assertSame('[]', $value);
}

public function testStringifyMustThrowExceptionNanOrInf(): void
Expand Down
Loading