From bc046848a2d673526f0098367bed793448881cad Mon Sep 17 00:00:00 2001 From: Fejan <63099555+fejan92@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:33:42 +0530 Subject: [PATCH] Sync rna-transcription (#737) --- .../rna-transcription/.meta/config.json | 2 +- .../rna-transcription/.meta/example.php | 22 -------- .../RnaTranscriptionTest.php | 51 +++++++++++-------- 3 files changed, 30 insertions(+), 45 deletions(-) diff --git a/exercises/practice/rna-transcription/.meta/config.json b/exercises/practice/rna-transcription/.meta/config.json index 12e20814..6527d828 100644 --- a/exercises/practice/rna-transcription/.meta/config.json +++ b/exercises/practice/rna-transcription/.meta/config.json @@ -21,5 +21,5 @@ }, "blurb": "Given a DNA strand, return its RNA Complement Transcription.", "source": "Hyperphysics", - "source_url": "https://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" + "source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" } diff --git a/exercises/practice/rna-transcription/.meta/example.php b/exercises/practice/rna-transcription/.meta/example.php index cc1b1255..3f29623f 100644 --- a/exercises/practice/rna-transcription/.meta/example.php +++ b/exercises/practice/rna-transcription/.meta/example.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); function toRna($strand) diff --git a/exercises/practice/rna-transcription/RnaTranscriptionTest.php b/exercises/practice/rna-transcription/RnaTranscriptionTest.php index 09b8be15..150f6c54 100644 --- a/exercises/practice/rna-transcription/RnaTranscriptionTest.php +++ b/exercises/practice/rna-transcription/RnaTranscriptionTest.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); class RnaTranscriptionTest extends PHPUnit\Framework\TestCase @@ -31,26 +9,55 @@ public static function setUpBeforeClass(): void require_once 'RnaTranscription.php'; } + /** + * @testdox It handles an empty string + * uuid b4631f82-c98c-4a2f-90b3-c5c2b6c6f661 + */ + public function testHandlesEmptyString(): void + { + $this->assertSame('', toRna('')); + } + + /** + * @testdox It transcribes guanine to cytosine + * uuid a9558a3c-318c-4240-9256-5d5ed47005a6 + */ public function testTranscribesGuanineToCytosine(): void { $this->assertSame('G', toRna('C')); } + /** + * @testdox It transcribes cytosine to guanine + * uuid 6eedbb5c-12cb-4c8b-9f51-f8320b4dc2e7 + */ public function testTranscribesCytosineToGuanine(): void { $this->assertSame('C', toRna('G')); } + /** + * @testdox It transcribes thymine to adenine + * uuid 870bd3ec-8487-471d-8d9a-a25046488d3e + */ public function testTranscribesThymineToAdenine(): void { $this->assertSame('A', toRna('T')); } + /** + * @testdox It transcribes adenine to uracil + * uuid aade8964-02e1-4073-872f-42d3ffd74c5f + */ public function testTranscribesAdenineToUracil(): void { $this->assertSame('U', toRna('A')); } + /** + * @testdox RNA complement + * uuid 79ed2757-f018-4f47-a1d7-34a559392dbf + */ public function testTranscribesAllOccurrencesOne(): void { $this->assertSame('UGCACCAGAAUU', toRna('ACGTGGTCTTAA'));