Adding new passing tests.
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.test / src / net / sourceforge / phpeclipse / xdebug / php / launching / PHPSourceLookupParticipantTest.java
index 2501476..ad46b6f 100644 (file)
@@ -1,5 +1,8 @@
 package net.sourceforge.phpeclipse.xdebug.php.launching;
 
+import net.sourceforge.phpeclipse.xdebug.php.model.XDebugStackFrame;
+import net.sourceforge.phpeclipse.xdebug.php.model.XDebugThread;
+
 import org.eclipse.core.runtime.CoreException;
 
 import junit.framework.TestCase;
@@ -8,7 +11,31 @@ public class PHPSourceLookupParticipantTest extends TestCase {
 
        public void testFindSourceElementsObject() throws CoreException {
                PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant();
-               psp.findSourceElements(new Object());
+               Object[] findSourceElements = psp.findSourceElements(new Object());
+               assertTrue("array should be empty",findSourceElements.length == 0);
+       }
+       
+       public void testFindSourceElementsObject_WithNull() throws CoreException {
+               PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant();
+               Object[] findSourceElements = psp.findSourceElements(null);
+               assertTrue("array should be empty",findSourceElements.length == 0);
+       }
+       public void testFindSourceElementsObject_WithXdebugStackFrame() throws CoreException {
+               PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant();
+               XDebugStackFrame frame = new MockXDebugStackFrame();
+               Object[] findSourceElements = psp.findSourceElements(frame);
+               assertTrue("array should be empty",findSourceElements.length == 0);
+       }
+       
+       class MockXDebugStackFrame extends XDebugStackFrame {
+               public MockXDebugStackFrame() {
+                       super(null, 0);
+               }
+       }
+       
+       public void testGetSourceName() throws CoreException {
+               PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant();
+               psp.getSourceName(null);
        }
-
 }
+