- Issue created by @ananthakrishnan.kr
- Status changed to Closed: works as designed
12 months ago 1:37pm 24 November 2023
I have integrated Poll module in my project and while working on the integration testing I am getting the below attached error.
1) Drupal\Tests\my_module\Functional\MyPollTest::testMyPoll
Exception: Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated
Drupal\Core\Database\Connection->escapeLike()() (Line: 1269)
/app/docroot/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:47
/app/vendor/guzzlehttp/promises/src/Promise.php:204
/app/vendor/guzzlehttp/promises/src/Promise.php:153
/app/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/app/vendor/guzzlehttp/promises/src/Promise.php:248
/app/vendor/guzzlehttp/promises/src/Promise.php:224
/app/vendor/guzzlehttp/promises/src/Promise.php:269
/app/vendor/guzzlehttp/promises/src/Promise.php:226
/app/vendor/guzzlehttp/promises/src/Promise.php:62
/app/vendor/guzzlehttp/guzzle/src/Client.php:187
/app/docroot/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/app/vendor/symfony/browser-kit/AbstractBrowser.php:403
/app/vendor/symfony/browser-kit/AbstractBrowser.php:320
/app/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:674
/app/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:462
/app/vendor/behat/mink/src/Element/NodeElement.php:153
/app/vendor/behat/mink/src/Element/NodeElement.php:161
/app/docroot/core/tests/Drupal/Tests/UiHelperTrait.php:100
/app/docroot/modules/custom/features/my_module/tests/src/Functional/MyPollTest.php:38
/app/docroot/modules/custom/features/my_module/tests/src/Functional/MyPollTest.php:25
/app/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
1. I created a custom module in my project to enable Poll.
2. Created a test file by extending BrowserTestBase.
3. In my test function,
-> I have logged in to the site and navigated to 'poll/add' page.
-> I filled the first choice by $this->getSession()->getPage()->fillField('choice[0][choice]', 'Test choice 1');
-> Then I clicked on Add another item by $this->click('#edit-choice-add-more');, I tried with $this->submitForm([], 'Add another item');- as well by referring to the module test file /poll/tests/src/Functional/PollTestBase.php
During the execution of this line , I am getting the above mentioned error.
Is anyone has experienced similar issue.
Thanks!
Closed: works as designed
1.6
Code