Archiwum dla Styczeń 2012
Wolno działający panel admina Drupal 6
Od pewnego czasu katowałem się bardzo wolno działającym panelem administracyjnym Drupala w przeglądarce Firefox nawet przy czystej instalacji. Dzięki pomocy znajomego okazało się, że problemem jest ustawienie na podstronie konfiguracji odpowiedniej wartości dla zmiennej.
W Firefoxie w pasku adresu wpisujemy
about:config
Potwierdzamy, że zgadzamy się z warunkami.
Na otwartej podstronie wyszukujemy:
network.dns.disableIPv6
i zmieniamy ją na TRUE.
Dodatkowo, spotkałem się także z zaleceniami wykomentowania (znak #) linijki
::1 localhost
w pliku
c:\Windows\System32\drivers\etc\hosts
Panel administracyjny powinien znacznie przyspieszyć.
Błąd podczas testów – PHP Fatal error: Call to a member function toString() on a non-object in ./PEAR/PHPUnit/Extensions/SeleniumTestCase.php on line 1041
H:\htdocs\demo\protected\tests>phpunit functional/SiteTest.php
PHPUnit 3.6.3 by Sebastian Bergmann.
Configuration read from H:\htdocs\demo\protected\tests\phpunit.xml
.PHP Fatal error: Call to a member function toString() on a non-object in C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 1041
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.4\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.4\phpunit:44
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:125
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:187
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:745
PHP 8. PHPUnit_Extensions_SeleniumTestCase->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:772
PHP 9. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php:527
PHP 10. PHPUnit_Framework_TestCase->runBare() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestResult.php:649
PHP 11. PHPUnit_Extensions_SeleniumTestCase->onNotSuccessfulTest() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestCase.php:888
Fatal error: Call to a member function toString() on a non-object in C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 1041
Call Stack:
0.0009 633648 1. {main}() C:\wamp\bin\php\php5.3.4\phpunit:0
0.1198 1189176 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.4\phpunit:44
0.1199 1189760 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:125
1.2804 7611776 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:187
1.3653 8098120 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\TestRunner.php:325
1.3654 8098680 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:705
12.7230 8521360 7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:745
12.7230 8521360 8. PHPUnit_Extensions_SeleniumTestCase->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:772
12.7230 8521408 9. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php:527
12.7230 8522416 10. PHPUnit_Framework_TestCase->runBare() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestResult.php:649
22.3495 8661592 11. PHPUnit_Extensions_SeleniumTestCase->onNotSuccessfulTest() C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestCase.php:888
W pliku C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php linijkę 1041 zmieniamy z:
$message = $e->getComparisonFailure()->toString();
na
$message = $e->getComparisonFailure()->exceptionToString;
Powinno zadziałać:
</pre> H:\htdocs\demo\protected\tests>phpunit functional/Sitetest.php PHPUnit 3.6.3 by Sebastian Bergmann. Configuration read from H:\htdocs\demo\protected\tests\phpunit.xml ..E Time: 37 seconds, Memory: 8.50Mb There was 1 error: 1) SiteTest::testLoginLogout Trying to get property of non-object C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php:1042 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestCase.php:888 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestResult.php:649 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Extensions\SeleniumTestCase.php:527 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:772 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:745 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\Framework\TestSuite.php:705 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\TestRunner.php:325 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:187 C:\wamp\bin\php\php5.3.4\PEAR\PHPUnit\TextUI\Command.php:125 C:\wamp\bin\php\php5.3.4\phpunit:44 FAILURES! Tests: 3, Assertions: 6, Errors: 1.