Skip to content

Commit

Permalink
Add red test
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiTsuchiya committed Feb 24, 2023
1 parent b5fd626 commit 55054fa
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Fake/FakePages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);

namespace Ray\MediaQuery;

class FakePages implements PagesInterface
{

public function offsetExists(mixed $offset): bool
{
// TODO: Implement offsetExists() method.
}

public function offsetGet(mixed $offset): mixed
{
// TODO: Implement offsetGet() method.
}

public function offsetSet(mixed $offset, mixed $value): void
{
// TODO: Implement offsetSet() method.
}

public function offsetUnset(mixed $offset): void
{
// TODO: Implement offsetUnset() method.
}

public function count(): int
{
// TODO: Implement count() method.
}
}
9 changes: 9 additions & 0 deletions tests/Fake/FakeReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ public function noPhpDoc(): Pages
{
}

public function noPhpDocFakePages(): FakePages
{
}

/**
* @todo Add return type!
*/
public function noReturnDoc(): Pages
{
}

/** @todo Add return type! */
public function noReturnDocFakePages(): FakePages
{
}

/**
* @return array<int>
*/
Expand Down
16 changes: 16 additions & 0 deletions tests/ReturnTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public function testnoPhpDoc(): void
$this->assertSame(null, $entity);
}

public function testNoPhpDocFakePages(): void
{
$method = new ReflectionMethod(new FakeReturn(), 'noPhpDocFakePages');
$entity = (new ReturnEntity())($method);

$this->assertSame(null, $entity);
}

public function testNoReturnDoc(): void
{
$method = new ReflectionMethod(new FakeReturn(), 'noReturnDoc');
Expand All @@ -50,6 +58,14 @@ public function testNoReturnDoc(): void
$this->assertSame(null, $entity);
}

public function testNoReturnDocFakePages(): void
{
$method = new ReflectionMethod(new FakeReturn(), 'noReturnDocFakePages');
$entity = (new ReturnEntity())($method);

$this->assertSame(null, $entity);
}

public function testNonEntityGeneric(): void
{
$method = new ReflectionMethod(new FakeReturn(), 'nonEntityGeneric');
Expand Down

0 comments on commit 55054fa

Please sign in to comment.