This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270789 - Exception thrown with empty tests
Summary: Exception thrown with empty tests
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: Dev
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-02 05:49 UTC by twifty
Modified: 2017-06-02 05:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description twifty 2017-06-02 05:49:14 UTC
Exception output below.

Using dev build and latest PHPUnit, when a TestCase contains a `test***` method which does NOT contain any assertations, the exception is thrown.

class Foo extends TestCase
{
    public function testMe()
    {
        // $this->assertTrue(true);
    }
}

Looking at the stack trace, I'm guessing the IDE is trying to read the test results when in-fact there are none.


java.lang.AssertionError: At least 2 lines must be found (message + stacktrace)
	at org.netbeans.modules.php.phpunit.run.PhpUnitLogParser.fillStacktrace(PhpUnitLogParser.java:216)
	at org.netbeans.modules.php.phpunit.run.PhpUnitLogParser.endTestContent(PhpUnitLogParser.java:199)
	at org.netbeans.modules.php.phpunit.run.PhpUnitLogParser.endElement(PhpUnitLogParser.java:128)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1776)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2964)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[catch] at org.netbeans.modules.php.phpunit.run.PhpUnitLogParser.parse(PhpUnitLogParser.java:88)
	at org.netbeans.modules.php.phpunit.run.TestRunner.createTestSession(TestRunner.java:102)
	at org.netbeans.modules.php.phpunit.run.TestRunner.runTests(TestRunner.java:85)
	at org.netbeans.modules.php.phpunit.PhpUnitTestingProvider.runTests(PhpUnitTestingProvider.java:136)
	at org.netbeans.modules.php.project.ui.testrunner.UnitTestRunner.runInternal(UnitTestRunner.java:132)
	at org.netbeans.modules.php.project.ui.testrunner.UnitTestRunner.run(UnitTestRunner.java:113)
	at org.netbeans.modules.php.project.ui.actions.support.ConfigActionTest.run(ConfigActionTest.java:231)
	at org.netbeans.modules.php.project.ui.actions.support.ConfigActionTest$RerunUnitTestHandler$1.run(ConfigActionTest.java:315)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)