Write tests for the module

Created on 10 January 2018, about 7 years ago
Updated 17 March 2023, about 2 years ago

Need write tests for the module.

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine tibezh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Patch #4 is not applied on drupal 10, Refer to screenshot.

  • Status changed to Needs work over 1 year ago
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • Assigned to danrod
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • Status changed to Active over 1 year ago
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    Patch #4 looks like a php file, probably the Test Class, I'll change this.

  • Status changed to Needs work about 1 year ago
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • Status changed to Active about 1 year ago
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    I pushed a change for this, but I am getting this error when trying to run the test, does anyone have any idea why is this test failing?

    daniel@drupal10-2-web:/var/www/html/web/core$ ../../vendor/bin/phpunit ../modules/contrib/timepicker/tests/src/Functional/TimeTestCaseTest.php 
    PHPUnit 9.6.15 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\timepicker\Functional\TimeTestCaseTest
    E                                                                   1 / 1 (100%)R
    
    Time: 00:05.944, Memory: 4.00 MB
    
    There was 1 error:
    
    1) Drupal\Tests\timepicker\Functional\TimeTestCaseTest::testTheSiteStillWorks
    TypeError: Drupal\Component\DependencyInjection\ReverseContainer::generateServiceIdHash(): Argument #1 ($object) must be of type object, null given
    
    /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/ReverseContainer.php:87
    /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/ReverseContainer.php:75
    /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php:903
    /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php:816
    /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:615
    /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:251
    /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83
    /var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:476
    /var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:559
    /var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
    /var/www/html/web/modules/contrib/timepicker/tests/src/Functional/TimeTestCaseTest.php:31
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    --
    
    There was 1 risky test:
    
    1) Drupal\Tests\timepicker\Functional\TimeTestCaseTest::testTheSiteStillWorks
    This test did not perform any assertions
    
    /var/www/html/web/core/tests/Drupal/Tests/Listeners/DrupalListener.php:60
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:452
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
    /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
    /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:144
    /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:97
    /var/www/html/vendor/bin/phpunit:122
    
    ERRORS!
    Tests: 1, Assertions: 0, Errors: 1, Risky: 1.
    
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    This needs some work.

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    I'll create some basic tests for this module, like checking out that the libraries are loading, that the site is up and checking some config changes after the module is installing. For testing the plugins, I'll need some time later to design some JavaScript tests, but I will create a separate ticket for that. For now I will create these tests to comply with some organization policies.

  • Merge request !25Resolve #2935633 "Few basic tests" β†’ (Closed) created by danrod
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    I'll close this issue, it's a a mess now.

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
Production build 0.71.5 2024