Skip to content

Commit d82f7cf

Browse files
committed
simplify test names
1 parent ec9d42b commit d82f7cf

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

src/Microplate/Scalars/Column12.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ class Column12 extends IntRange
88
{
99
public ?string $description = 'Represents a column in a coordinate system with 12 columns. Allowed values range from 1-12.';
1010

11-
protected static function max(): int
11+
protected static function min(): int
1212
{
13-
return 12;
13+
return 1;
1414
}
1515

16-
protected static function min(): int
16+
protected static function max(): int
1717
{
18-
return 1;
18+
return 12;
1919
}
2020
}

tests/Microplate/Scalars/Column12Test.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,38 @@ protected function setUp(): void
1818
}
1919
}
2020

21-
public function testSerializeThrowsIfColumn12IsNotAnInt(): void
21+
public function testSerializeThrowsIfNotAnInt(): void
2222
{
2323
$this->expectException(\InvalidArgumentException::class);
2424
$this->expectExceptionMessage('Value not in range 1-12: "12".');
2525

2626
(new Column12())->serialize('12');
2727
}
2828

29-
public function testSerializeThrowsIfColumn12IsInvalid(): void
29+
public function testSerializeThrowsIfInvalid(): void
3030
{
3131
$this->expectException(\InvalidArgumentException::class);
3232
$this->expectExceptionMessage('Value not in range 1-12: 13.');
3333

3434
(new Column12())->serialize(13);
3535
}
3636

37-
public function testSerializePassesWhenColumn12IsValid(): void
37+
public function testSerializePassesValid(): void
3838
{
3939
$serializedResult = (new Column12())->serialize(12);
4040

4141
self::assertSame(12, $serializedResult);
4242
}
4343

44-
public function testParseValueThrowsIfColumn12IsInvalid(): void
44+
public function testParseValueThrowsIfInvalid(): void
4545
{
4646
$this->expectException(Error::class);
4747
$this->expectExceptionMessage('Value not in range 1-12: 13.');
4848

4949
(new Column12())->parseValue(13);
5050
}
5151

52-
public function testParseValuePassesIfColumn12IsValid(): void
52+
public function testParseValuePassesIfValid(): void
5353
{
5454
self::assertSame(
5555
12,

tests/Microplate/Scalars/Column2Test.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,38 @@ protected function setUp(): void
1818
}
1919
}
2020

21-
public function testSerializeThrowsIfColumn2WellIsNotAnInt(): void
21+
public function testSerializeThrowsIfNotAnInt(): void
2222
{
2323
$this->expectException(\InvalidArgumentException::class);
2424
$this->expectExceptionMessage('Value not in range 1-2: "3".');
2525

2626
(new Column2())->serialize('3');
2727
}
2828

29-
public function testSerializeThrowsIfColumn2WellIsInvalid(): void
29+
public function testSerializeThrowsIfInvalid(): void
3030
{
3131
$this->expectException(\InvalidArgumentException::class);
3232
$this->expectExceptionMessage('Value not in range 1-2: 3.');
3333

3434
(new Column2())->serialize(3);
3535
}
3636

37-
public function testSerializePassesWhenColumn2WellIsValid(): void
37+
public function testSerializePassesWhenValid(): void
3838
{
3939
$serializedResult = (new Column2())->serialize(2);
4040

4141
self::assertSame(2, $serializedResult);
4242
}
4343

44-
public function testParseValueThrowsIfColumn2WellIsInvalid(): void
44+
public function testParseValueThrowsIfInvalid(): void
4545
{
4646
$this->expectException(Error::class);
4747
$this->expectExceptionMessage('Value not in range 1-2: 3.');
4848

4949
(new Column2())->parseValue(3);
5050
}
5151

52-
public function testParseValuePassesIfColumn2WellIsValid(): void
52+
public function testParseValuePassesIfValid(): void
5353
{
5454
self::assertSame(
5555
2,

tests/Microplate/Scalars/Row16Test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@ protected function setUp(): void
1919
}
2020
}
2121

22-
public function testSerializeThrowsIfRow16IsInvalid(): void
22+
public function testSerializeThrowsIfInvalid(): void
2323
{
2424
$this->expectException(InvariantViolation::class);
2525
$this->expectExceptionMessage('The given value "W" did not match the regex /^[A-P]$/.');
2626

2727
(new Row16())->serialize('W');
2828
}
2929

30-
public function testSerializeThrowsIfRow16IsNonCapital(): void
30+
public function testSerializeThrowsIfNonCapital(): void
3131
{
3232
$this->expectException(InvariantViolation::class);
3333
$this->expectExceptionMessage('The given value "b" did not match the regex /^[A-P]$/.');
3434

3535
(new Row16())->serialize('b');
3636
}
3737

38-
public function testSerializePassesWhenRow16IsValid(): void
38+
public function testSerializePassesWhenValid(): void
3939
{
4040
$serializedResult = (new Row16())->serialize('H');
4141

4242
self::assertSame('H', $serializedResult);
4343
}
4444

45-
public function testParseValueThrowsIfRow16IsInvalid(): void
45+
public function testParseValueThrowsIfInvalid(): void
4646
{
4747
$this->expectException(Error::class);
4848
$this->expectExceptionMessage('The given value "W" did not match the regex /^[A-P]$/.');
4949

5050
(new Row16())->parseValue('W');
5151
}
5252

53-
public function testParseValueThrowsIfRow16IsNonCapital(): void
53+
public function testParseValueThrowsIfNonCapital(): void
5454
{
5555
$this->expectException(Error::class);
5656
$this->expectExceptionMessage('The given value "h" did not match the regex /^[A-P]$/.');
5757

5858
(new Row16())->parseValue('h');
5959
}
6060

61-
public function testParseValuePassesIfRow16IsValid(): void
61+
public function testParseValuePassesIfValid(): void
6262
{
6363
self::assertSame(
6464
'P',

tests/Microplate/Scalars/Row8Test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@ protected function setUp(): void
1919
}
2020
}
2121

22-
public function testSerializeThrowsIfRow8IsInvalid(): void
22+
public function testSerializeThrowsIfInvalid(): void
2323
{
2424
$this->expectException(InvariantViolation::class);
2525
$this->expectExceptionMessage('The given value "I" did not match the regex /^[A-H]$/.');
2626

2727
(new Row8())->serialize('I');
2828
}
2929

30-
public function testSerializeThrowsIfRow8IsNonCapital(): void
30+
public function testSerializeThrowsIfNonCapital(): void
3131
{
3232
$this->expectException(InvariantViolation::class);
3333
$this->expectExceptionMessage('The given value "h" did not match the regex /^[A-H]$/.');
3434

3535
(new Row8())->serialize('h');
3636
}
3737

38-
public function testSerializePassesWhenRow8IsValid(): void
38+
public function testSerializePassesWhenValid(): void
3939
{
4040
$serializedResult = (new Row8())->serialize('H');
4141

4242
self::assertSame('H', $serializedResult);
4343
}
4444

45-
public function testParseValueThrowsIfRow8IsInvalid(): void
45+
public function testParseValueThrowsIfInvalid(): void
4646
{
4747
$this->expectException(Error::class);
4848
$this->expectExceptionMessage('The given value "I" did not match the regex /^[A-H]$/.');
4949

5050
(new Row8())->parseValue('I');
5151
}
5252

53-
public function testParseValueThrowsIfRow8IsNonCapital(): void
53+
public function testParseValueThrowsIfNonCapital(): void
5454
{
5555
$this->expectException(Error::class);
5656
$this->expectExceptionMessage('The given value "h" did not match the regex /^[A-H]$/.');
5757

5858
(new Row8())->parseValue('h');
5959
}
6060

61-
public function testParseValuePassesIfRow8IsValid(): void
61+
public function testParseValuePassesIfValid(): void
6262
{
6363
self::assertSame(
6464
'H',

0 commit comments

Comments
 (0)