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
22 changes: 0 additions & 22 deletions exercises/practice/nucleotide-count/.meta/example.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
<?php

/*
* By adding type hints and enabling strict type checking, code can become
* easier to read, self-documenting and reduce the number of potential bugs.
* By default, type declarations are non-strict, which means they will attempt
* to change the original type to match the type specified by the
* type-declaration.
*
* In other words, if you pass a string to a function requiring a float,
* it will attempt to convert the string value to a float.
*
* To enable strict mode, a single declare directive must be placed at the top
* of the file.
* This means that the strictness of typing is configured on a per-file basis.
* This directive not only affects the type declarations of parameters, but also
* a function's return type.
*
* For more info review the Concept on strict type checking in the PHP track
* <link>.
*
* To disable strict typing, comment out the directive below.
*/

declare(strict_types=1);

function nucleotideCount($dna)
Expand Down
28 changes: 6 additions & 22 deletions exercises/practice/nucleotide-count/NucleotideCountTest.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
<?php

/*
* By adding type hints and enabling strict type checking, code can become
* easier to read, self-documenting and reduce the number of potential bugs.
* By default, type declarations are non-strict, which means they will attempt
* to change the original type to match the type specified by the
* type-declaration.
*
* In other words, if you pass a string to a function requiring a float,
* it will attempt to convert the string value to a float.
*
* To enable strict mode, a single declare directive must be placed at the top
* of the file.
* This means that the strictness of typing is configured on a per-file basis.
* This directive not only affects the type declarations of parameters, but also
* a function's return type.
*
* For more info review the Concept on strict type checking in the PHP track
* <link>.
*
* To disable strict typing, comment out the directive below.
*/

declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\TestDox;

class NucleotideCountTest extends TestCase
{
Expand All @@ -36,6 +15,7 @@ public static function setUpBeforeClass(): void
/**
* uuid: 3e5c30a8-87e2-4845-a815-a49671ade970
*/
#[TestDox('Empty DNA sequence')]
public function testEmptyDNASequence(): void
{
$this->assertSame([
Expand All @@ -49,6 +29,7 @@ public function testEmptyDNASequence(): void
/**
* uuid: a0ea42a6-06d9-4ac6-828c-7ccaccf98fec
*/
#[TestDox('DNA sequence with single nucleotide')]
public function testDNASequenceSingleNucleotide(): void
{
$this->assertSame([
Expand All @@ -62,6 +43,7 @@ public function testDNASequenceSingleNucleotide(): void
/**
* uuid: eca0d565-ed8c-43e7-9033-6cefbf5115b5
*/
#[TestDox('Repetitive DNA sequence')]
public function testRepetitiveDNASequence(): void
{
$this->assertSame([
Expand All @@ -75,6 +57,7 @@ public function testRepetitiveDNASequence(): void
/**
* uuid: 40a45eac-c83f-4740-901a-20b22d15a39f
*/
#[TestDox('DNA sequence with multiple nucleotides')]
public function testDNASequenceWithMultipleNucleotides(): void
{
$this->assertSame([
Expand All @@ -88,6 +71,7 @@ public function testDNASequenceWithMultipleNucleotides(): void
/**
* uuid: b4c47851-ee9e-4b0a-be70-a86e343bd851
*/
#[TestDox('DNA sequence with invalid nucleotides')]
public function testDNASequenceWithInvalidNucleotides(): void
{
$this->expectException(Exception::class);
Expand Down
Loading