public function testFooShouldHaveAnnotations() { $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/Foo.class.php"); $this->assertEquals(is_array($annotations), true, "Annotations for Foo.class.php should be an array."); $this->assertArrayHasKey("helloWorld", $annotations, "Annotations for Foo.class.php should have a definition for helloWorld"); $this->assertArrayHasKey("bar", $annotations, "Annotations for Foo.class.php should have a definition for bar"); }
public function testAnnotationsShouldReturnMessage() { $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("ModelNotFound.class.php"); $this->assertEquals(is_array($annotations), true, "Annotations should be an array."); $this->assertCount(1, $annotations, "Annotations array should only have one element."); $this->assertArrayHasKey(0, $annotations, "Annotations should contain a key 0."); $this->assertContains("does not exist", $annotations[0], "Element at first position should have a 'does not exist' message."); }
<?php include "application/bin/MetaDescription/Annotation.class.php"; include "application/bin/Utility/Functions.class.php"; $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/Foo.class.php"); Sandbox\Bin\Utility\Functions::dump($annotations); $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/PersonViewModel.class.php"); Sandbox\Bin\Utility\Functions::dump($annotations); $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/Bar.class.php"); Sandbox\Bin\Utility\Functions::dump($annotations); $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("ModelNotFound.class.php"); Sandbox\Bin\Utility\Functions::dump($annotations);
public function testFooShouldHaveAnnotations() { $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/PersonViewModel.class.php"); $this->assertEquals(is_array($annotations), true, "Annotations for PersonViewModel.class.php should be an array."); $this->assertCount(7, $annotations, "Annotations for PersonViewModel.class.php should contain 7 elements."); }
public function testBarShouldHaveAnnotations() { $annotations = Sandbox\Bin\MetaDescription\Annotation::discover("models/Bar.class.php"); $this->assertEquals(is_array($annotations), true, "Annotations for Bar.class.php should be an array."); $this->assertCount(0, $annotations, "Annotations for Bar.class.php should not contain any elements."); }