#42277 closed enhancement (fixed)
Remove useless tests from `Tests_Basic`
Reported by: | Frank Klein | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-unit-tests |
Focuses: | Cc: |
Description
The Tests_Basic
class contains several tests, which do not seem to be testing anything useful:
test_globals()
andtest_globals_bar()
: The bug in question has been fixed for a long time, plus issues with PHPUnit should be handled upstream.test_setting_nonexistent_arrays()
,test_magic_getter()
,test_subclass_magic_getter()
,test_call_method()
,test_subclass_magic_getter()
,test_call_method()
,test_subclass_call_method()
,test_subclass_isset()
, andtest_subclass_unset()
all needlessly test basic PHP features._switch_order_helper()
is unused, except in it'stest_switch_order()
test, and sinceTests_Basic
is a test class, it can be removed.
Some of these tests have been added for HHVM support, but are no longer needed after this support was removed as part of #40548.
Attachments (1)
Change History (10)
#2
@
7 years ago
- Keywords has-unit-tests added; needs-unit-tests removed
- Milestone changed from Awaiting Review to 5.0
- Owner set to johnbillion
- Status changed from new to reviewing
#4
@
7 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Why were the basic object classes removed? See #37523
#5
@
7 years ago
@TimothyBlynJacobs They were removed because they do not actually test anything, besides normal PHP behaviour.
Is there a use case for the WordPress Core tests that was missed?
#6
@
7 years ago
Because they are helpful objects when writing tests with the WP test lib. I don't see any issue with removing the unnecessary PHP functionality tests, but I don't see why the basic object classes themselves were removed.
#7
@
7 years ago
They were removed because Core does not need them anymore. In my view there's enough outstanding work on tests that we should not continue to invest resources into code that is no longer needed.
Consider including these classes in your own testing setup if you find them useful.
In 42381: