? ? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
2 Aug 2021

Pull Request for Issue # .

Summary of Changes

This pull request (PR) fixes unit tests for the "getPluralSuffixes" function of JText currently failing when executed locally (at least on Linux).

No idea why they don't fail in drone CI.

The failure is caused by file "tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.localise.php" having not been adapted with PR #28763 .

In addition, this PR adds a missing test case for the "more than 1" case.

Testing Instructions

  1. On a git clone, checkout and if necessary update the staging branch so it's up to date with the staging branch here.
  2. Open a command window and change directory to the root folder of that git clone.
  3. Run composer install.
  4. Run ./libraries/vendor/phpunit/phpunit/phpunit ./tests/unit/suites/libraries/joomla/language/JLanguageTest.php
    Result: See section "Actual result BEFORE applying this Pull Request" below.
  5. Revert all local changes by running these 2 git commands:
    git clean -d -x -f
    git checkout .
  6. Apply the changes from this PR.
  7. Repeat steps 2 to 4.
    Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

richard@vmubu01:~/lamp/public_html/joomla-cms$ ./libraries/vendor/phpunit/phpunit/phpunit ./tests/unit/suites/libraries/joomla/language/JLanguageTest.php
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Warning:	The Xdebug extension is not loaded
		No code coverage will be generated.

......F.....................................

Time: 113 ms, Memory: 10.00MB

There was 1 failure:

1) JLanguageTest::testGetPluralSuffixes
Line: 286
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'ONE'
-    1 => '1'
+    0 => '1'
 )

/home/richard/lamp/public_html/joomla-cms/tests/unit/suites/libraries/joomla/language/JLanguageTest.php:286

FAILURES!
Tests: 44, Assertions: 119, Failures: 1.

Expected result AFTER applying this Pull Request

richard@vmubu01:~/lamp/public_html/joomla-cms$ ./libraries/vendor/phpunit/phpunit/phpunit ./tests/unit/suites/libraries/joomla/language/JLanguageTest.php
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Warning:	The Xdebug extension is not loaded
		No code coverage will be generated.

............................................

Time: 118 ms, Memory: 8.00MB

OK (44 tests, 120 assertions)

Documentation Changes Required

None.

avatar richard67 richard67 - open - 2 Aug 2021
avatar richard67 richard67 - change - 2 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Aug 2021
Category Unit Tests
avatar richard67 richard67 - change - 2 Aug 2021
Title
Fix language strings plural suffixes unit test
Fix language strings plural suffixes unit test failing when executed locally
avatar richard67 richard67 - edited - 2 Aug 2021
avatar richard67 richard67 - change - 2 Aug 2021
Title
Fix language strings plural suffixes unit test failing when executed locally
Fix language strings plural suffixes unit test failing when executing JLanguageTest.php alone
avatar richard67 richard67 - edited - 2 Aug 2021
avatar Fedik
Fedik - comment - 2 Aug 2021

from code review looks good,
but unfortunately cannot run local unittest, do not have php 5 installed, and it somehow not work with 8

avatar RickR2H RickR2H - test_item - 2 Aug 2021 - Tested successfully
avatar RickR2H
RickR2H - comment - 2 Aug 2021

I have tested this item successfully on d02dfd8

Patch works.

For people testing on Windows, make sure PHP is added to your system path variables.
Then use: php ./libraries/vendor/phpunit/phpunit/phpunit ./tests/unit/suites/libraries/joomla/language/JLanguageTest.php


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35026.
avatar RickR2H
RickR2H - comment - 3 Aug 2021

@ricardo1709 please test ?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35026.

avatar ricardo1709 ricardo1709 - test_item - 4 Aug 2021 - Tested successfully
avatar ricardo1709
ricardo1709 - comment - 4 Aug 2021

I have tested this item successfully on d02dfd8

The patch works.
I have tested it on WSL


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35026.

avatar richard67 richard67 - change - 4 Aug 2021
Status Pending Ready to Commit
avatar richard67 richard67 - edited - 4 Aug 2021
avatar richard67
richard67 - comment - 4 Aug 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35026.

avatar wilsonge wilsonge - change - 4 Aug 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-04 23:38:28
Closed_By wilsonge
Labels Added: ? ? ?
avatar wilsonge wilsonge - close - 4 Aug 2021
avatar wilsonge wilsonge - merge - 4 Aug 2021
avatar wilsonge
wilsonge - comment - 4 Aug 2021

Merging as this just affects tests

Add a Comment

Login with GitHub to post a comment