Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing null coalescing operator in Reporter.php #6642

Closed
thomashohn opened this issue Feb 15, 2023 · 0 comments · Fixed by #6643
Closed

Missing null coalescing operator in Reporter.php #6642

thomashohn opened this issue Feb 15, 2023 · 0 comments · Fixed by #6643

Comments

@thomashohn
Copy link
Contributor

thomashohn commented Feb 15, 2023

What are you trying to achieve?

I wan't to start a simple test that does nothing. But the chromedriver and and chrome browser have incompatible versions.
Before PHP 8 it would inform the user that This version of ChromeDriver only supports Chrome version XXX

 Test  Tests/Acceptance/NoopCest.php:testNoop
                                                                                                                                                                                                                                                                                                                                                                                                                            
  [Facebook\WebDriver\Exception\SessionNotCreatedException] session not created: This version of ChromeDriver only supports Chrome version 108
Current browser version is 110.0.5481.100 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  (Driver info: chromedriver=108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016}),platform=Mac OS X 11.7.3 x86_64)  
                                                                                                                                                                                                                                                                                                                                                                                                                            
#1

What do you get instead?

Uncaught TypeError: strcasecmp(): Argument #1 ($string1) must be of type string, null given

Provide console output if related. Use -vvv mode for more details.

PHP Fatal error:  Uncaught TypeError: strcasecmp(): Argument #1 ($string1) must be of type string, null given in XXX/vendor/codeception/codeception/ext/Recorder.php:463
Stack trace:
#0 XXX/vendor/codeception/codeception/ext/Recorder.php(463): strcasecmp(NULL, '/Users/tho/Deve...')
#1 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Codeception\Extension\Recorder->persist(Object(Codeception\Event\FailEvent), 'test.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'test.error', Object(Codeception\Event\FailEvent))
#3 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(296): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Codeception\Event\FailEvent), 'test.error')
#4 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(163): Codeception\Test\Test->fire('test.error', Object(Codeception\Event\FailEvent))
#5 XXX/vendor/codeception/codeception/src/Codeception/Suite.php(130): Codeception\Test\Test->realRun(Object(Codeception\ResultAggregator))
#6 XXX/vendor/codeception/codeception/src/Codeception/SuiteManager.php(148): Codeception\Suite->run(Object(Codeception\ResultAggregator))
#7 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(260): Codeception\SuiteManager->run(Object(Codeception\ResultAggregator))
#8 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(216): Codeception\Codecept->runSuite(Array, 'Acceptance', 'NoopCest')
#9 XXX/vendor/codeception/codeception/src/Codeception/Command/Run.php(435): Codeception\Codecept->run('Acceptance', 'NoopCest', Array)
#10 XXX/vendor/symfony/console/Command/Command.php(298): Codeception\Command\Run->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 XXX/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 XXX/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Codeception\Command\Run), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 XXX/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 XXX/vendor/codeception/codeception/src/Codeception/Application.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 XXX/vendor/codeception/codeception/app.php(45): Codeception\Application->run()
#16 XXX/vendor/codeception/codeception/app.php(46): {closure}()
#17 XXX/vendor/codeception/codeception/codecept(7): require('/Users/tho/Deve...')
#18 XXX/vendor/bin/codecept(120): include('/Users/tho/Deve...')
#19 {main}
  thrown in XXX/vendor/codeception/codeception/ext/Recorder.php on line 463

Fatal error: Uncaught TypeError: strcasecmp(): Argument #1 ($string1) must be of type string, null given in XXX/vendor/codeception/codeception/ext/Recorder.php:463
Stack trace:
#0 XXX/vendor/codeception/codeception/ext/Recorder.php(463): strcasecmp(NULL, '/Users/tho/Deve...')
#1 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Codeception\Extension\Recorder->persist(Object(Codeception\Event\FailEvent), 'test.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'test.error', Object(Codeception\Event\FailEvent))
#3 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(296): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Codeception\Event\FailEvent), 'test.error')
#4 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(163): Codeception\Test\Test->fire('test.error', Object(Codeception\Event\FailEvent))
#5 XXX/vendor/codeception/codeception/src/Codeception/Suite.php(130): Codeception\Test\Test->realRun(Object(Codeception\ResultAggregator))
#6 XXX/vendor/codeception/codeception/src/Codeception/SuiteManager.php(148): Codeception\Suite->run(Object(Codeception\ResultAggregator))
#7 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(260): Codeception\SuiteManager->run(Object(Codeception\ResultAggregator))
#8 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(216): Codeception\Codecept->runSuite(Array, 'Acceptance', 'NoopCest')
#9 XXX/vendor/codeception/codeception/src/Codeception/Command/Run.php(435): Codeception\Codecept->run('Acceptance', 'NoopCest', Array)
#10 XXX/vendor/symfony/console/Command/Command.php(298): Codeception\Command\Run->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 XXX/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 XXX/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Codeception\Command\Run), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 XXX/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 XXX/vendor/codeception/codeception/src/Codeception/Application.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 XXX/vendor/codeception/codeception/app.php(45): Codeception\Application->run()
#16 XXX/vendor/codeception/codeception/app.php(46): {closure}()
#17 XXX/vendor/codeception/codeception/codecept(7): require('/Users/tho/Deve...')
#18 XXX/vendor/bin/codecept(120): include('/Users/tho/Deve...')
#19 {main}
  thrown in XXX/vendor/codeception/codeception/ext/Recorder.php on line 463



FATAL ERROR. TESTS NOT FINISHED.
Uncaught TypeError: strcasecmp(): Argument #1 ($string1) must be of type string, null given in XXX/vendor/codeception/codeception/ext/Recorder.php:463
Stack trace:
#0 XXX/vendor/codeception/codeception/ext/Recorder.php(463): strcasecmp(NULL, '/Users/tho/Deve...')
#1 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Codeception\Extension\Recorder->persist(Object(Codeception\Event\FailEvent), 'test.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 XXX/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'test.error', Object(Codeception\Event\FailEvent))
#3 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(296): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Codeception\Event\FailEvent), 'test.error')
#4 XXX/vendor/codeception/codeception/src/Codeception/Test/Test.php(163): Codeception\Test\Test->fire('test.error', Object(Codeception\Event\FailEvent))
#5 XXX/vendor/codeception/codeception/src/Codeception/Suite.php(130): Codeception\Test\Test->realRun(Object(Codeception\ResultAggregator))
#6 XXX/vendor/codeception/codeception/src/Codeception/SuiteManager.php(148): Codeception\Suite->run(Object(Codeception\ResultAggregator))
#7 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(260): Codeception\SuiteManager->run(Object(Codeception\ResultAggregator))
#8 XXX/vendor/codeception/codeception/src/Codeception/Codecept.php(216): Codeception\Codecept->runSuite(Array, 'Acceptance', 'NoopCest')
#9 XXX/vendor/codeception/codeception/src/Codeception/Command/Run.php(435): Codeception\Codecept->run('Acceptance', 'NoopCest', Array)
#10 XXX/vendor/symfony/console/Command/Command.php(298): Codeception\Command\Run->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 XXX/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 XXX/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Codeception\Command\Run), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 XXX/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 XXX/vendor/codeception/codeception/src/Codeception/Application.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 XXX/vendor/codeception/codeception/app.php(45): Codeception\Application->run()
#16 XXX/vendor/codeception/codeception/app.php(46): {closure}()
#17 XXX/vendor/codeception/codeception/codecept(7): require('/Users/tho/Deve...')
#18 XXX/vendor/bin/codecept(120): include('/Users/tho/Deve...')
#19 {main}
  thrown 
in XXX/vendor/codeception/codeception/ext/Recorder.php:463

Provide test source code if related

// paste test

Details

  • Codeception version: 5.0,9
  • PHP Version: > 8
  • Operating System: MacOS
  • Installation type: Composer
  • List of installed packages (composer show) Not relevant
  • Suite configuration:
# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

actor: AcceptanceTester
modules:
  enabled:
    - WebDriver:
        url: '%TEST_SERVER%'
        browser: chrome
        port: 9515 #chromeDrvier port
        log_js_errors: true
        window_size: 1920x1080
        wait: 2
        capabilities:
          chromeOptions:
            args: [ "--headless", "--no-sandbox", "--disable-dev-shm-usage", "--enable-features=NetworkService,NetworkServiceInProcess", "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" ]
            "prefs": {
              "download.default_directory": "/tmp/",
              "download.directory_upgrade": "true",
              "download.extensions_to_open": "",
              "download.prompt_for_download": "false"
            }
            w3c: false
    - Asserts
    - REST:
        depends: PhpBrowser
        url: '%TEST_SERVER%'
thomashohn added a commit to thomashohn/Codeception that referenced this issue Feb 15, 2023
Naktibalda added a commit that referenced this issue Feb 18, 2023
[BUGFIX] #6642 Added a missing null coalescing operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant