Task #51436

Standalone unit test runner

Added by Christian Kuhn almost 2 years ago. Updated about 1 year ago.

Status:Resolved Start date:2014-02-10
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Unit/Functional Tests Spent time: -
Target version:6.2.0
TYPO3 Version:6.2 Complexity:
PHP Version:5.4 Sprint Focus:

Description


Subtasks

Bug #55846: Remove backup of TYPO3_DBResolved

Task #55850: Reduce memory footprint of unit testsResolved

Task #56681: Unit tests bootstrap simplificationResolved

Bug #56684: Tests: Incomplete mocking in ResourceFactoryTestResolved

Bug #56686: Tests: Incomplete mocking in Backent TestsResolvedAnja Leichsenring

Bug #56687: Tests: Incomplete mocking in be_userResolved

Bug #56688: [BUGFIX] Resolve incomplete mocking for sysext:fluidResolvedAnja Leichsenring

Task #56689: Tests: Simplify unit test bootstrapResolved

Bug #56696: Tests: Incomplete mocking of $GLOBALS['TCA'] in ext:coreResolved

Bug #56698: Tests: Incomplete mocking of $GLOBALS['TCA'] in ext:frontendResolvedAnja Leichsenring

Bug #56699: Tests: Improve TCA mocking in BackendUtilityResolved

Bug #56700: Tests: Improve Mocking in ext:extbaseResolvedAnja Leichsenring

Bug #56718: Tests: Improve mocking in ext:belogResolved

Bug #56725: Improve mocking in IconUtilityTestResolved

Bug #56739: Remove loadExtensionTables from unit test bootstrapResolved

Bug #56787: Tests: Incomplete mocking in ext:schedulerResolved

Bug #56788: Tests: Incomplete mocking in ext:frontendResolved

Bug #56791: Tests: Incomplete mocking in ext:beuserResolved

Bug #56854: Tests: Incomplete mocking in BackendUtilityTestResolved

Bug #56894: Incomplete mock in ext:schedulerResolved

Bug #56895: Tests: Incomplete mocking in ext:schedulerClosedAnja Leichsenring

Bug #56907: Remove unmaintainable testResolved

Bug #56912: Incomplete mocking in backend condition matcher testResolved

Bug #56914: Tests: Incomplete mocking in ext:fluidResolved

Bug #56918: Tests: Improve mocking in ext:coreResolved

Bug #56921: Refactor log writer tests in ext:coreResolved

Bug #56922: Tests: Incomplete mocking in PreparedStatementTestResolved

Bug #56924: Remove unmaintainable testclassResolved

Bug #56930: Tests: Incomplete Mocking in ext:extensionmanagerResolvedAnja Leichsenring

Bug #56936: Tests: Replace objectManager with mock in ext:extbaseResolvedAnja Leichsenring

Bug #56937: Tests: Refactor cache Typo3DatabaseBackendResolved

Bug #56938: Tests: Improve mocking in DatabaseConnectionTestResolved

Bug #56939: Tests: Incomplete mock in IndexerServiceTestResolved

Bug #56940: Tests: Skip some FAL testsResolved

Bug #56942: Tests: Release em tests from extbase base classResolved

Bug #56943: Release ext:form tests from exbase base classResolved

Bug #56947: Tests: incomplete mock of TYPO3_DBResolved

Task #56948: Remove initialization of TYPO3_DB from unit test bootstrapResolved

Task #56949: Tests: Do not extend from extbase BaseTestCaseResolved

Task #56958: Tests: Extend from UnitBaseTest in ext:fluidResolved

Task #56961: Tests: Inherit from UnitTestCase in ext:extbaseResolved

Bug #56963: Remove extbase BaseTestCaseResolved

Task #56967: Tests: Reduce unit test bootstrapResolved

Bug #57035: Do not load LocalConfiguration in unit test bootstrapResolved

Bug #57185: Tests: Stabilize readPngGifFixesPermissionsOfConvertedFileResolved

Bug #57872: Tests: Namespaced usage of vfsStreamResolved

Task #57971: Use composer for unit and functional tests in travisResolved

Bug #58433: Speed up functional testsResolved

Bug #58527: Refactor and activate dbal testsResolved

Task #58531: Tests: Activate ext:rsaauth test suiteResolved

Bug #58533: Tests: Find all unit tests automaticallyResolved


Related issues

related to Core - Bug #52813: Better mocking in BackendUtility::viewOnClick test Resolved 2013-10-14
related to Core - Bug #52819: Better mocking in FormProtection tests Resolved 2013-10-14
related to Core - Bug #52865: Incomplete mock in ext:frontend FAL getData test Resolved 2013-10-15
related to Core - Task #52868: Enable mock of ResourceFactory in ContentObjectRenderer Resolved 2013-10-15
related to Core - Bug #52643: ContentObjectRendererTest -> getImgResourceHookGetsCalled... Resolved 2013-10-09
related to Core - Bug #53476: Better mocking of $GLOBALS['LANG'] Resolved 2013-11-09
related to Core - Bug #53558: Refactor PageRenderer tests Resolved 2013-11-12

Associated revisions

Revision d6ee9efa
Added by Helmut Hummel almost 2 years ago

[TASK] Bootstrap for Unit Tests

Until now we still needed the phpunit extension
to be installed and cli access to be configured
to execute unit tests.

This change introduces a bootstrap file which
can be used to execute the unit test suite
without the extension.

It is of course still possible to use the PHPUnit
and VHS framework files present in the extension.

This change also splits user initialization into
separate bootstrap methods and allows the PATH_site
and PATH_thisScript constants to be set outside
the bootstrap.

Activate Travis CI to make use of this.

Change-Id: I43f51896fd9895ead8d0084f37d34f3347f1c5e5
Resolves: #51436
Releases: 6.2

Revision f362ed73
Added by Helmut Hummel almost 2 years ago

[TASK] Bootstrap for Unit Tests

Until now we still needed the phpunit extension
to be installed and cli access to be configured
to execute unit tests.

This change introduces a bootstrap file which
can be used to execute the unit test suite
without the extension.

It is of course still possible to use the PHPUnit
and VHS framework files present in the extension.

This change also splits user initialization into
separate bootstrap methods and allows the PATH_site
and PATH_thisScript constants to be set outside
the bootstrap.

Activate Travis CI to make use of this.

Resolves: #51436
Releases: 6.2
Change-Id: I43f51896fd9895ead8d0084f37d34f3347f1c5e5
Reviewed-on: https://review.typo3.org/23396
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Tested-by: Philipp Gampe
Reviewed-by: Philipp Gampe
Tested-by: Markus Klein
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision d7c03b86
Added by Christian Kuhn over 1 year ago

[TASK] Better mocking of $GLOBALS['LANG']

To further remove dependencies in unit tests, some tests are
adapted to correctly mock $GLOBALS['LANG']. The PageRenderer
tests still need adaptions in a separate patch, so the test
bootstrap still initializes the language handling for now.

Change-Id: I5d6a8a0a0fe738fef676fbc637a02fe9700ccee3
Resolves: #53476
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/25234
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision ac6599fc
Added by Christian Kuhn over 1 year ago

[TASK] Refactor PageRenderer tests

The existing tests of ext:core/Page/PageRenderer are in fact
functional tests since most of them trigger lots of dependencies
and call the main API method "render()" to check for something.

The patch moves most detail tests to two general functional tests
doing the main work and adds some more functional tests for more
specific cases.
The unit tests are stripped down to those parts that test only single
methods or smaller systems with proper mocking.

In effect, the full unit test suite does no longer depend on
initialization of $GLOBALS['LANG'], it is now removed from unit
test bootstrap.

Change-Id: I9f3f54ba52673e16bfcd303b46755e079d240de6
Resolves: #53558
Related: #51436
Related: #53476
Releases: 6.2
Reviewed-on: https://review.typo3.org/25304
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 03d4a807
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Remove backup of TYPO3_DB

All $GLOBALS are backed up by phpunit, no explicit backup
of $GLOBALS['TYPO3_DB'] is required.

Change-Id: I2859a5922d85a23fa8281382b1d78043ec7bd934
Resolves: #55846
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/27526
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 2d05837d
Added by Christian Kuhn over 1 year ago

[TASK] Reduce memory footprint of unit tests

Running the whole unit test suite on cli can eat up a significant
amount of memory. Most of that can not be mitigated due to phpunit
itself, but we can at least hint the PHP garbage collection by
unsetting test class properties in tearDown().

The patch introduces a generic tearDown() method that reflects the
test class and unsets all temporary properties of the class. In
effect, tests do not need to take care of unsetting properties.

The patch removes all tearDown() methods that only unset() stuff
and keeps others that do additional things but adds a call to
parent::tearDown(). Private properties are changed to protected,
so parent::tearDown can reach them. The additional computing
effort of the reflection is insignificant, the suite is nearly as
fast as before.

Results:
php 5.3: 1056MB -> 851MB
php 5.4: 870MB -> 670MB
php 5.5.: 876MB -> 674MB

Resolves: #55850
Related: #51436
Releases: 6.2
Change-Id: Ie665c53a3ab35e4808677e483d2099e0511c393f
Reviewed-on: https://review.typo3.org/27528
Reviewed-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 59b76a52
Added by Christian Kuhn over 1 year ago

[TASK] Reduce unit test bootstrap

With the removal of $GLOBALS['FILEMOUNTS'] the unit test no longer
depend on initialization of backend user mounts. Remove this
bootstrap line.

Change-Id: Ie9860dd7b15a4baff330c8e3cad16d3ae3092e75
Resolves: #56681
Related: #55547
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28190
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 11088709
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mock in ResourceFactoryTest

FAL ResourceFactoryTest retrieveFileOrFolderObject* not only
tests the method but also lots of not mocked dependencies. The
tests are renamed and changed to stick to test the subject only.

Resolves: #56684
Related: #51436
Releases: 6.2
Change-Id: If247e923b8e79995279ad48bdc35f5b8976bfd57
Reviewed-on: https://review.typo3.org/28192
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 123663e5
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in be_user

ModuleDataStorageServiceTest now mocks $GLOBALS['BE_USER']
to not rely on instantiation of this global.

Change-Id: I5ab6b962d95f2ab183dfc1b1b53dea7deaa464c5
Resolves: #56687
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28196
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision cdd9ad09
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Simplify unit test bootstrap

There is no need to initialize $GLOBALS['BE_USER'] anymore
in unit tests since mocking of this dependency is complete.

Change-Id: I21ab751d4b66ba2d9658becbd6e0fcd16d139c4b
Resolves: #56689
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28199
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 6f493ac7
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking of $GLOBALS['TCA'] in ext:core

To reduce dependencies of tests and improve readability, some tests
can be improved by better mocking of $GLOBALS['TCA']

Change-Id: I7dee44b5a98f2384c2b77c51ebc678ff15669475
Resolves: #56696
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28203
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision cdf716b4
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Incomplete mocking of $GLOBALS['TCA'] in ext:frontend

To reduce dependencies of tests and improve readability, some tests
can be improved by better mocking of $GLOBALS['TCA'].

Change-Id: Ib38f2dd94288c5c4f8940d3c8c969ea0459ebbcb
Resolves: #56698
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28204
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision da605eba
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Improve TCA mocking in BackendUtility

ext:core BackendUtilityTest no longer depends on initialized TCA.

Change-Id: I5b97b86d57da15b6176dd3033ec8fda1f4209f85
Resolves: #56699
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28206
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 6695000d
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Improve Mocking in ext:extbase

Change-Id: I61f7f92da42d691b0556f1e53b20d39eb082c12f
Resolves: #56700
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28207
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 9e7e81fb
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Improve mocking in ext:belog

The subject method initialize() calls some static dependencies
that can not be mocked. They do DB actions in the end. The patch
now mocks TYPO3_DB to suppress this DB call.

Change-Id: I43b0e002bfab081ed41a5c259011f465b507a74b
Resolves: #56718
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28215
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision d413b2f6
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Improve mocking in IconUtilityTest

The IconUtility tests depend on initialized $GLOBALS['TBE_STYLES']
and sometimes on initialized $GLOBALS['TCA']. This dependency is
removed by properly setting up needed arrays now, this also makes
the tests more obvious and easier to understand.
Additionally, the static cache property introduced with #56110 now
uses late static binding, enabling the tests to extend the class
and route any static cache changes to an test internal overlay
class to not pollute the static property of the base class.

Change-Id: I01166058da051a26d7aa2df315858468828ed346
Resolves: #56725
Related: #51436
Related: #56110
Releases: 6.2
Reviewed-on: https://review.typo3.org/28220
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 4a56fd23
Added by Christian Kuhn over 1 year ago

[TASK] Remove loadExtensionTables() from unit test bootstrap

With proper mocking in place, loadExtensionTables() can be
removed from unit test bootstrap.
This speeds up the test suite quite a bit since the huge
$GLOBALS['TCA'] is no longer initialized and gives backup code
of phpunit less headaches.

Change-Id: I9ac96047a49914f3c6ab7acc318bbc36488b6c5b
Resolves: #56739
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28235
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision bbfaf395
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in ext:scheduler

Use getMock() instead of new() to create the test subject in order to
suppress execution of __construct() of parent AbstractTask.

Change-Id: Id0c297b845db7064b15a859eefa71830ab12074d
Resolves: #56787
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28273
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision e0fee4ad
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in ext:beuser

The module data storage test subject calls several static
dependencies that can not be mocked without code refactoring. Those
dependencies do database stuff in the end, so DB needs to be properly
mocked for this test.

Change-Id: Id882b3a3a785940b5499c9afeff67f193c480e3b
Resolves: #56791
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28275
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision f61e17ed
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in ext:frontend

Improve the fluid standalone tests by not calling __construct() of
a dependency.
Additionally, renderWorksWithNestedFluidtemplate() not only tests
the standalone view, but also its connection to the content object
renderer, so this is more a functional than a unit test. The test
is streamlined and moved to the functional test suite.

Change-Id: I3ae357de4861395622bc6f70aeed6011c7760cde
Resolves: #56788
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28274
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 6741ab10
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Improve Mocking in ext:extbase

Unittests reveal some warnings which are caused by incomplete mocking.

Change-Id: Iee09220d675335aeadd286c2d4544d53c981016f
Resolves: #56700
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28365
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 71373b3c
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in BackendUtilityTest

Remove dependencies in BackendUtilityTest with better mocking and
introduce static:: instead of self:: in BackendUtility for late
static binding.
The flexForm test for getExcludeFields() is separated to an own
test and an array duplication bug confusing array key and value
in getExcludeFields() is fixed along the way.

Change-Id: If242bab64075aee5050dfc77317e54dcb2f5e25d
Resolves: #56854
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28331
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

Revision dbf686f3
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: improve Mocking in ext:extbase

Unittests reveal some warnings which are caused by incomplete mocking.

Change-Id: I42089bb6c9016187d83382a2fa10450310993a84
Resolves: #56700
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28370
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision c96a2a57
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mock in ext:scheduler

Do not call __construct of subject.

Change-Id: I7b936efde9220c847b0a6278ea0d5b3606203e17
Resolves: #56894
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28374
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision eb84fc9d
Added by Christian Kuhn over 1 year ago

[TASK] Remove not maintainable test

ext:backend test getNodesSetsIsMountPointField() works on getNode()
of PageTree DataProvider. The method has tons of dependencies that
are sometimes even static, and the method is recursive. It is very
hard to test properly and the current test is still not mocking
completly. The test is removed for now since it does not give us
much benefit and is hard to maintain in current state, the subject
method should be covered by tests again if it was refactored.

Change-Id: I344c584b4d6e3868471f4857a08223be3a5d03e4
Resolves: #56907
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28384
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 3194a29e
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in backend condition matcher

Mock deterimenRootline to suppress calling database stuff
in dependencies.

Change-Id: I54938f9e20d52eda568c6520fa7bd72ec19b61e2
Resolves: #56912
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28388
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision babb8ebc
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in ext:fluid

Change-Id: I4bd6ff219c3232211106e968fce45ee3f2dd674a
Resolves: #56914
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28390
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 05601363
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Better mocking in ext:core

Some tests still rely on initialized $GLOBALS['TYPO3_DB']. The patch
handles some easy cases in ext:core.

Change-Id: I5b720154035cc5f8b156a9358806673daaf9c9ec
Resolves: #56918
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28394
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 8bec5130
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Refactor log writer tests in ext:core

Test files and class naming is adapted to subject class names in
ext:core Log/Writer and the DatabaseWriterTests are rewritten to
not depend on initialized database connection anymore.

Change-Id: Ifff4e5a064018bb5b0db3bf9eeb1b9232adfb262
Resolves: #56921
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28396
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision f6f52eac
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mocking in PreparedStatementTest

Release PreparedStatementTest from an active DB connection. The
quote tests are refactored a bit to find out in one specific test
if it is done for parameters.

Change-Id: I37853cd49368c2b23d0c2d6926fc806618674279
Resolves: #56922
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28398
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 16545e59
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Incomplete Mocking in ext:extensionmanager

After the removal of GLOBALS initialisation the extension raises
warnings in unittests.

Change-Id: I450932b1de1852302e4ae9861b250c5721f6032e
Resolves: #56930
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28412
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik

Revision ffbde247
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Improve mocking in ext:extbase

Unit tests reveal some warnings which are caused by incomplete
mocking. They all belong to $GLOBALS['LANG']

Change-Id: Ic2adda9984a530b82e259c1d8931015996f167ba
Resolves: #56700
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28407
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision f6a923c7
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Refactor cache Typo3DatabaseBackend

Tests of the Typo3DatabaseBackend are refactored to not depend on
initialized $GLOBALS['TYPO3_DB'] anymore, queries and quoting is
now performed to a mock object. Next to a better separation this
has the advantage of a nice speedup executing those tests.

Change-Id: I8fc23fec56a50e48f74422eac3ee4a07ed3669b9
Resolves: #56937
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28420
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 43308189
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Improve mocking in DatabaseConnectionTest

With the switch to mysqli object it is now possible to fully mock
and check the final database calls in DatabaseConnectionTest, the
test table can be removed after refactoring the tests.

Change-Id: I60e33f6af5b4be8111a21469d12e38843650e7c4
Resolves: #56938
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28422
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 1941db90
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mock in IndexerServiceTest

Change-Id: Idad4b11894ee6e09e0b8eca9a057c7a776925a70
Resolves: #56939
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28423
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision cc909e68
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Skip some FAL tests

While the FAL tests were already streamlined and simplified a lot,
the ResourceStorageTest class is still a mixture of functional and
unit test that involves heavy set up code and still does not mock
dependencies properly.
This test class needs a rewrite and a clean separation of units
together with a number of working functional tests to be of any use.
For now, all tests that rely on initialized database are skipped and
marked as TODO.

Change-Id: I3191c809c50f4f19ab91b9a5b5f2f3ebc3fa47ff
Resolves: #56940
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28424
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 5736216d
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Release em tests from extbase base class

Extbase BaseTestClass comes with a not mocked objectManager that
gives headaches if it is injected to a test subject. Releasing
the extensionmanager test classes from this and using core
UnitTestCase as parent reveals these parts in existing tests,
those are fixed with the patch.

Change-Id: Ia7acd7f838f9ac0eb2f44e0737893fc30c41ff55
Resolves: #56942
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28427
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 520e3653
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Release ext:form tests from exbase base class

Change-Id: I7e9f09fa747a07208bf248aa35fdf154cd1fa9c4
Resolves: #56943
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28428
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision f2a9fd67
Added by Anja Leichsenring over 1 year ago

[BUGFIX] Tests: Replace objectManager with mock in ext:extbase

The usage of native objectManager in Extbase' BaseTestClass introduces
a dependency to the systems database. In order to reduce the unit test
bootstrap this dependency must be resolved.

Change-Id: I862664d4ca032d18f22b18677816bed1e1bc2a4a
Resolves: #56936
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28421
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

Revision 9cdedd07
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Incomplete mock of $GLOBALS['TYPO3_DB']

Still some unit tests rely on TYPO3_DB, mostly through the extbase
object manager. The patch fixes most occurrences and skips two
complex tests that should be moved to functional tests later.

This should be the final patch for tests accessing TYPO3_DB.

Change-Id: I8deb0fb9c13b47c8ce4262f041744def9e6b0e79
Resolves: #56947
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28431
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 3736f998
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Do not initialize TYPO3_DB in unit tests

Change-Id: I9d147353411314416cdf1f5196d18a127e8c5145
Resolves: #56948
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28432
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision d8667e0e
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Do not extend from extbase BaseTestCase

Changes all extensions except extbase and fluid to extend
from extbase ext:core UnitTestCase instead of ext:extbase
BaseTestCase.

Change-Id: Ifbb1542546f2622ece11471fd057ec469518488a
Resolves: #56949
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28434
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 96646e1a
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Inherit from UnitTestCase in ext:fluid

Changes class inheritance from ext:exbase BaseTestCase
to ext:core UnitTestCase in ext:fluid

Change-Id: I46667d9cb5a56f5bc29c4f2c3525c6556d5f802f
Resolves: #56958
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28440
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision b5e6c668
Added by Christian Kuhn over 1 year ago

[TASK] Inherit from UnitTestCase in ext:extbase

Changes class inheritance from ext:exbase BaseTestCase
to ext:core UnitTestCase in ext:extbase

Change-Id: If2d2afbc05765b3ff1d8fa3fded17e6fb0eecd44
Resolves: #56961
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28441
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision 9d0f4607
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Remove extbase BaseTestCase

Lots of unit tests did inherit from extbase BaseTestCase. Meanwhile
all code of this abstract was merged to ext:core UnitTestCase and
with the refactoring of the core unit test boostrap the objectManager
that is still in this class does not work anymore.
The class is now removed, but since this is probably used in some
third party extensions, it is set as class alias to ext:core
UnitTestCase and marked as deprecated in a lecagy file, so IDEs
hint developers about this deprecation.

Change-Id: I31fb337e065aed7f03351cb04e13c68a98c93a34
Resolves: #56963
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28445
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision f8eb2337
Added by Christian Kuhn over 1 year ago

[TASK] Tests: Reduce unit test bootstrap

The patch further reduces the unit test bootstrap: ext_localconf
of extensions is not loaded anymore and the cache framework is
no longer initialized. A test with incommplete mocking in this area
is fixed along the way.
Furthermore the core exception handling is no longer initialized,
so it does not depend on configuration options. A warning
triggered by a unit test will now reliable let the test fail.

Change-Id: I659441482a19eb6b434d520ecded6df8f5086820
Resolves: #51436
Related: #56967
Releases: 6.2
Reviewed-on: https://review.typo3.org/28449
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 3e3feef3
Added by Christian Kuhn over 1 year ago

[TASK] Remove db setup from .travis.yml

With proper mocking in place we no longer need an
initialized database to run unit tests.

Change-Id: I3913186540bbd1b1419c37132cddaaa34ea9ca34
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28645
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision c0655d67
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Remove some useless tests

Some tests of GeneralUtility depend on LocalConfiguration
settings and can not easily be mocked in a sane way. They
are also not very helpfull and the functionality tested is
unlikly to break. They are removed for now.

Change-Id: Ic162e950d4df75e1b8aea63a6c547139efabdf15
Resolves: #57185
Related: #51436
Related: #57035
Releases: 6.2
Reviewed-on: https://review.typo3.org/28644
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision ca9c89c2
Added by Christian Kuhn over 1 year ago

[BUGFIX] Do not load LocalConfiguration in unit test bootstrap

The patch removes loadConfigurationAndInitialize() from unit test
bootstrap and substitutes it with some more fine grained bootstrap
calls. In effect, the instance specific LocalConfiguration.php is
no longer loaded and removes another depencency from unit tests
to the instance.

Change-Id: Ia6591fe8d40d530558a514832c8d649c46b4ccc9
Resolves: #57035
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28491
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision 4ecf9038
Added by Christian Kuhn over 1 year ago

[BUGFIX] Tests: Namespaced usage of vfsStream

vfsStream was namespaced a while ago. While ext:phpunit still has
a Migration to map non namespaced classes to the namespaced ones,
they should not be used any longer.

Change-Id: I44dcda6707cf6410125f01552c995a27113b3cc2
Resolves: #57872
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/29440
Reviewed-by: Oliver Klee
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 9f87a730
Added by Christian Kuhn over 1 year ago

[TASK] Use composer for unit and functional tests in travis

The patch uses composer based dependency handling and other
stuff pushing travis-ci tests to the next level:

- phpunit registered as "dev" requirement in composer.json
- vfsStream registered as "dev" requirement in composer.json
- cms-composer-installers is not released stable and adapted
in composer.json for successful dependency resolving via
composer
- cloning travis-integration repository is obsolete by inlining
scripts in .travis.yml
- cloning ext:phpunit is obsolete, native phpunit by composer
is used now
- it is possible to set functional test suite database credentials
with environment variables, used in .travis.yml
- redis cache backend tests are enabled on travis-ci again
- use existing php modules of travis-ci environment speeds up build

With phpunit from composer, the command to run tests is
./bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
More documentation about that can be found at
http://wiki.typo3.org/Unit_Testing_TYPO3

Change-Id: I4d524e8e0249ca22f34fc48b7209d60d72e5e921
Resolves: #57971
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/29495
Reviewed-by: Wouter Wolters
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision 30f2ba08
Added by Christian Kuhn about 1 year ago

[TASK] Tests: Refactor and activate dbal tests

Our unit test environment is finally ready to execute existing dbal
unit tests, even if no database connection exists.

The patch refactors unit tests of ext:dbal, modernizes their codebase
and adds them to the build.

Resolves: #52527
Related: #51436
Releases: 6.2
Change-Id: I70507591dc89331d658d50196dfcaea002caa7d5
Reviewed-on: https://review.typo3.org/29874
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision 3010c21e
Added by Christian Kuhn about 1 year ago

[TASK] Tests: Activate ext:rsaauth test suite

The test suite of ext:rsaauth is missing in UnitTests.xml, add it.

Resolves: #58531
Related: #58530
Related: #51436
Releases: 6.2
Change-Id: I5c1c8bbf415ed53270a09bdf68df300e28eb5f09
Reviewed-on: https://review.typo3.org/29878
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision cf6cde21
Added by Christian Kuhn about 1 year ago

[TASK] Tests: Find all tests automatically

All regular unit tests are located at
typo3/sysext/"extension"/Tests/Unit. The patch substitutes the single
suite registration in UnitTests.xml with a wildcard, only "Legacy"
and "Integration" tests are still registered as special locations.

Following this schema, tests located at default locations within
extensions will be found automatically without explicit registration.

Resolves: #58533
Related: #51436
Releases: 6.2
Change-Id: Ic822a68f60060437d2e3aabea7754f5b1e72af50
Reviewed-on: https://review.typo3.org/29879
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision dad69621
Added by Christian Kuhn about 1 year ago

[BUGFIX] ext:rsaauth cliBackend pollutes cli output

The CommandLineBackend using exec "openssl genrsa" outputs its key
generation to standard error. If SAPI is cli (eg. in unit tests),
this is is shown to the user. The patch silences openssl by
redirecting stderr to /dev/null (NUL on Windows systems).

Resolves: #58530
Related: #51436
Releases: 6.2
Change-Id: I702d2d3180bc2e32e5548a4402d4eefb02dd2523
Reviewed-on: https://review.typo3.org/29877
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes

History

#1 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#2 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#3 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#4 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#5 Updated by Gerrit Code Review almost 2 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#6 Updated by Gerrit Code Review almost 2 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23396

#7 Updated by Helmut Hummel almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Christian Kuhn over 1 year ago

  • Status changed from Resolved to Accepted
  • Estimated time set to 0.00

#10 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review
  • Estimated time set to 0.00

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28449

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28449

#12 Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 98 to 100

#13 Updated by Gerrit Code Review about 1 year ago

  • Estimated time deleted (0.00)

Also available in: Atom PDF