From 3aa2d27cbbb0402a4786d46ff819f712b553ff8c Mon Sep 17 00:00:00 2001 From: Ivar van der Burg Date: Tue, 7 Apr 2015 13:35:32 +0200 Subject: [PATCH] Test has() method --- tests/Versioner/CombineReadersTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Versioner/CombineReadersTest.php b/tests/Versioner/CombineReadersTest.php index 91ae885..9c8cd88 100644 --- a/tests/Versioner/CombineReadersTest.php +++ b/tests/Versioner/CombineReadersTest.php @@ -79,4 +79,25 @@ public function testFileFirstWithCombine() ) ); } + + public function testHasAVersion() + { + $versioner = new Versioner; + + // This one should have a version + $versioner->setReaders( + array(new FileReader('VERSION')) + ); + return $this->assertTrue( + $versioner->has(__DIR__ . '/../projects/composer-file/') + ); + + // Should not have a version + $versioner->setReaders( + array(new FileReader('FOO')) + ); + return $this->assertFalse( + $versioner->has(__DIR__ . '/../projects/composer-file/') + ); + } }