After the installation of PHPunit 8.0.1 I got this error:
Fatal error: Declaration of Symfony\Bundle\FrameworkBundle\Test\KernelTestCase::tearDown() must be compatible with PHPUnit\Framework\TestCase::tearDown()
I am using PHP 7.2
Your tearDown function is not compatible with the function you extend.
You have to add the return type in order to implement the same declaration.
protected function tearDown(): void
See also documentation https://phpunit.de/announcements/phpunit-8.html section "Return Type of Template Methods"
Related
Quoting https://phpunit.readthedocs.io/en/9.5/writing-tests-for-phpunit.html#testing-php-errors-warnings-and-notices , "By default, PHPUnit converts PHP errors, warnings, and notices that are triggered during the execution of a test to an exception". Bearing that in mind, here's my unit test:
<?php
class DemoTest extends PHPUnit\Framework\TestCase
{
public function testDemo()
{
try {
trigger_error('zzz', E_USER_DEPRECATED);
} catch (\Throwable $e) {}
}
}
When I run vendor/bin/phpunit on that with PHPUnit 9.4.0 on PHP 8.0.9 I get the following (irrelevant parts of the output have been removed):
PHPUnit 9.4.0 by Sebastian Bergmann and contributors.
R 1 / 1 (100%)
When I run vendor/bin/phpunit on that on PHPUnit 9.4.0 on PHP 8.1.0 I get the following:
Deprecated: PHPUnit\Runner\DefaultTestResultCache implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\path\to\code\vendor\phpunit\phpunit\src\Runner\DefaultTestResultCache.php on line 34
PHPUnit 9.4.0 by Sebastian Bergmann and contributors.
R 1 / 1 (100%)
ie. in PHP 8.1 it's like I'm getting a full dump of the Throwable, stack trace included, whereas I'm not getting that in PHP 8.0.
Any ideas? I don't want to see the error in the output and, if an exception isn't being thrown, then $this->expectException('PHPUnit\\Framework\\Error\\Deprecated') isn't gonna work for me either
This is an incompatibility of PHPUnit with PHP 8.1 and has already been fixed a while back in 9.5.5, so you need to update.
9.4 is not a supported version anymore.
Environment: Symfony 2.8.1 with XAMPP Version 5.5.24 on Windows 7.
If I trigger a fatal error in a controller, anything as simple as $array = ; in production environment, I'm getting a default php error:
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\tgsupport-test\src\AppBundle\Controller\DefaultController.php on line 16
followed by symfony custom error page message. Obviously I'd want to avoid to show eorr info in production.
Moreover in prod.log I see a double critical error: under php.CRITICAL and request.CRITICAL. Is really useful to show the same error twice?
I'm using default configuration, indeed I just installed default framework without any custom setting and I triggered my error in AppBundle/DefaultController, so I was wondering if I'm missing anything.
I missed a php.ini configuration to avoid to display error messages in page.
I have just installed Manjaro Linux and suddenly, using this system, I am getting this error. I did not do anything for few days and it was working perfectly in Debian. The full error is:
Attempted to call function "iconv_strlen" from namespace "Symfony\Bridge\Doctrine\Logger".
And also
Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedFunctionException: "Attempted to call function "iconv_strlen" from namespace "Symfony\Bridge\Doctrine\Logger"." at /home/gabriel/NetBeansProjects/CasaDoGesso/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php line 102
What do I do?
It seems in Manjaro/Arch I had to uncomment the iconv.so exention in /etc/php/php.ini. Now it is working.
I recently updated from Qt 5.3 to Qt 5.5. Since the update, I can't seem to get macdeployqt to work properly. When I call it for my application, I get the following output:
Michaels-Mac-mini:Desktop michael$ ~/Qt/5.5/clang_64/bin/macdeployqt FlySightViewer.app
ERROR: Cannot resolve rpath "libvlc-qt.dylib (compatibility version 0.0.0, current version 0.0.0)"
ERROR: using QSet("/Users/michael/Qt/5.5/clang_64/lib")
ERROR: Cannot resolve rpath "libvlc-qt.dylib (compatibility version 0.0.0, current version 0.0.0)"
ERROR: using QSet("/Users/michael/Qt/5.5/clang_64/lib")
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtQuick.framework/Versions/5/QtQuick"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtQml.framework/Versions/5/QtQml"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtGui.framework/Versions/5/QtGui"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Versions/5/QtCore"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets"
WARNING: Plugin "libqsqlodbc.dylib" uses private API and is not Mac App store compliant.
WARNING: Plugin "libqsqlpsql.dylib" uses private API and is not Mac App store compliant.
ERROR: no file at "/usr/local/lib/libpq.5.dylib"
What catches my attention in particular are the six errors that refer to ~/Qt5.3.2/5.3. This is where the old version of Qt was installed, but the only version I currently have installed is Qt 5.5. It seems like there is some reference in my project/system to the old version, but I have no idea where to look for it. Any help would be greatly appreciated!
I am getting below error when I am trying to use the SwingLibrary
java.lang.ClassCastException: SwingLibrary cannot be cast to org.robotframework.javalib.library.RobotJavaLibrary
My Keyword is written like below
*** Keywords ***
Start Demo Application
[Arguments] ${name}
Start Application ${name} java ${MAIN CLASS} 10 seconds ${LIB DIRECTORY}
Take Library Into Use SwingLibrary
I see that my application does get invoked but I get error.
Please help.
EDIT: this issue was fixed in the 1.9.1 release.
The newest version of SwingLibrary no longer implements AnnotationLibrary (which implements RobotJavaLibrary). It has the necessary methods so you should be able to subclass it and use that library with RemoteApplications.
public class RemotableSwingLibrary extends SwingLibrary implements RobotJavaLibrary {}