Commits

John Chandler committed fe57b9d

Added test and code for parsing an empty PHP file

Comments (0)

Files changed (4)

qadpid/__init__.py

+"""
+ 'Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.'
+ - Golding
+"""
+"""
+Parser Code
+"""
+
+class PHPFileParser( object ):
+    """ PHP File Parser """
+    def parse( self, file_text ):
+        """ parse the file_text and return a list of include/require dependencies """
+        return []
+    

tests/__init__.py

+"""
+ 'If debugging is the process of removing bugs, then programming must be the process of putting them in.'
+ - Dijkstra
+"""
+

tests/test_parser.py

 
 from unittest import TestCase
 
+from qadpid.parser import PHPFileParser
+
 
 class TestParser( TestCase ):
     """ Tests for the PHP file parser """
-    def test_parse_include( self ):
-        """ Test for presence of an include """
-        self.fail("Not Yet Implemented")
+    def test_parse_nothing( self ):
+        """ Test for empty file contents """
+        self.assertEquals( PHPFileParser().parse(""), [] )
+
 
 if __name__ == '__main__':
     unittest.main()