Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Add constants CoordinateSystem*Well::POSITIONS_COUNT and `Microplat…
Browse files Browse the repository at this point in the history
…eSet*::PLATE_COUNT`
  • Loading branch information
spawnia authored Sep 19, 2023
1 parent a2588a8 commit d7f0074
Show file tree
Hide file tree
Showing 10 changed files with 962 additions and 557 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## v6.3.0

### Added

- Add constants `CoordinateSystem*Well::POSITIONS_COUNT`
- Add constants `MicroplateSet*::PLATE_COUNT`

## v6.2.0

### Added
Expand Down
1,466 changes: 909 additions & 557 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/CoordinateSystem12Well.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

final class CoordinateSystem12Well extends CoordinateSystem
{
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
public const POSITIONS_COUNT = 12;

public function rows(): array
{
return range('A', 'C');
Expand Down
3 changes: 3 additions & 0 deletions src/CoordinateSystem48Well.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

final class CoordinateSystem48Well extends CoordinateSystem
{
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
public const POSITIONS_COUNT = 48;

public function rows(): array
{
return range('A', 'F');
Expand Down
3 changes: 3 additions & 0 deletions src/CoordinateSystem96Well.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

final class CoordinateSystem96Well extends CoordinateSystem
{
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
public const POSITIONS_COUNT = 96;

public function rows(): array
{
return range('A', 'H');
Expand Down
3 changes: 3 additions & 0 deletions src/MicroplateSet/MicroplateSetAB.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*/
final class MicroplateSetAB extends MicroplateSet
{
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
public const PLATE_COUNT = 2;

public function plateIDs(): array
{
return ['A', 'B'];
Expand Down
3 changes: 3 additions & 0 deletions src/MicroplateSet/MicroplateSetABCD.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*/
final class MicroplateSetABCD extends MicroplateSet
{
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
public const PLATE_COUNT = 4;

public function plateIDs(): array
{
return ['A', 'B', 'C', 'D'];
Expand Down
3 changes: 3 additions & 0 deletions src/MicroplateSet/MicroplateSetABCDE.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*/
final class MicroplateSetABCDE extends MicroplateSet
{
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
public const PLATE_COUNT = 5;

public function plateIDs(): array
{
return ['A', 'B', 'C', 'D', 'E'];
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/CoordinateSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,11 @@ public static function firstLast(): iterable
yield [new CoordinateSystem48Well(), 'A1', 'F8'];
yield [new CoordinateSystem96Well(), 'A1', 'H12'];
}

public function testPositionsCount(): void
{
self::assertSame(CoordinateSystem12Well::POSITIONS_COUNT, (new CoordinateSystem12Well())->positionsCount());
self::assertSame(CoordinateSystem48Well::POSITIONS_COUNT, (new CoordinateSystem48Well())->positionsCount());
self::assertSame(CoordinateSystem96Well::POSITIONS_COUNT, (new CoordinateSystem96Well())->positionsCount());
}
}
21 changes: 21 additions & 0 deletions tests/Unit/MicroplateSetTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php declare(strict_types=1);

namespace Mll\Microplate\Tests\Unit;

use Mll\Microplate\CoordinateSystem96Well;
use Mll\Microplate\MicroplateSet\MicroplateSetAB;
use Mll\Microplate\MicroplateSet\MicroplateSetABCD;
use Mll\Microplate\MicroplateSet\MicroplateSetABCDE;
use PHPUnit\Framework\TestCase;

final class MicroplateSetTest extends TestCase
{
public function testPlateCount(): void
{
$anyCoordinateSystemWillDo = new CoordinateSystem96Well();

self::assertSame(MicroplateSetAB::PLATE_COUNT, (new MicroplateSetAB($anyCoordinateSystemWillDo))->plateCount());
self::assertSame(MicroplateSetABCD::PLATE_COUNT, (new MicroplateSetABCD($anyCoordinateSystemWillDo))->plateCount());
self::assertSame(MicroplateSetABCDE::PLATE_COUNT, (new MicroplateSetABCDE($anyCoordinateSystemWillDo))->plateCount());
}
}

0 comments on commit d7f0074

Please sign in to comment.