1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-31 02:32:37 +02:00

159 Commits

Author SHA1 Message Date
Deltik
eec2feb8b3
pluginsTest::testBanner() e_parse cases
See https://github.com/e107inc/e107/issues/3547 for details.
2018-11-08 21:05:24 -06:00
Cameron
e9e9f6288e Added placeholder test for Media-Manager upload processing. 2018-11-03 12:59:06 -07:00
Nick Liu
9e0d603609
100% test coverage for \e107\Shims
New test forces a failover of the `readfile()` internal function to
test the failover functionality of \e107\Shims\Internal::readfile()
2018-11-03 09:11:42 -05:00
Nick Liu
7c2b4f8f25
Reload e_shortcode_parser for pluginsTest::testBanner()
e_shortcode_parser normally doesn't need reloading in an e107
installation because installing the "banner" plugin and parsing
shortcodes have always been two separate script calls (page loads).

It would slow down the e107 core to add an e_shortcode_parser reloader
after installing a plugin when the page would later exit without
parsing any shortcodes.
2018-11-02 12:49:24 -05:00
Nick Liu
f27636ff14
Fixed race condition in e_parseTest::testToForm()
Other tests have been meddling with the e107::wysiwyg() global state

e_parseTest::testToForm() now considers two outcomes of the
e107::wysiwyg() state.
2018-11-01 19:31:04 -05:00
Nick Liu
556aea02ea
Removed Internet dependency from pluginsTest::testRemotePlugin() 2018-11-01 19:12:11 -05:00
Nick Liu
b9f794b1a9
Disregard race condition by increasing tolerance in e107pluginTest
e107pluginTest::testXmlSiteLinks() ignores the primary key and model
order because another test could have inserted records before this test.
2018-11-01 19:09:48 -05:00
Nick Liu
aa458ee7d3
Explicit timezone settings in e_DateTest and e_formTest 2018-11-01 18:49:20 -05:00
Nick Liu
9e6bb14641
Removed Internet dependency from e_marketplaceTest 2018-11-01 18:48:06 -05:00
Nick Liu
da8a2015aa
Consistency fix for e_formTest 2018-11-01 14:33:43 -05:00
Nick Liu
1fc01e08f0
Fixed rollback bug in GitPreparer
Added a guard to GitPreparer::unsetVcsInProgress() to prevent doing a
`git reset` when there are no test locks present.

Otherwise, the uncommitted changes in the app will be removed by the
shutdown feature introduced in 952c6e5890daa36236be675d8c4f21cecabc1fe7.
2018-11-01 09:32:43 -05:00
Nick Liu
93d8b7f0c5
General repo cleanup
Removed unused includes/bootstrap.php

Made a new e107 sample database dump
2018-11-01 07:20:11 -05:00
Nick Liu
952c6e5890
PriorityCallbacks: Execute callbacks before Codeception's
GitPreparer now registers a "priority" register_shutdown_function
callback in order to clean up in case of a fatal error.
2018-11-01 06:57:38 -05:00
Nick Liu
6f416523c3
Renamed e_shims to eShims
To follow @myovchev's convention like eHelper

Per @CaMer0n
2018-10-31 12:27:45 -05:00
Nick Liu
f145622207
Added tests for e_shims 2018-10-31 08:06:42 -05:00
Cameron
10a21270f4 Comment added for date lapse issue. 2018-10-04 15:54:28 -07:00
Cameron
871a0f4da3 Basic test for {e_BASE} added. 2018-10-02 11:51:47 -07:00
Nick Liu
e9f89cede6
InstallCest now clears the database
InstallCest now drops all tables from the test database before running
each test.

Fixes: #13
2018-09-30 14:06:19 -05:00
Nick Liu
c512dc2fcc
Started but couldn't test e_parse_shortcode 2018-09-27 11:32:06 -05:00
Nick Liu
9125b60b59
Added performance test for e_form::inlineToken() 2018-09-23 15:39:37 -05:00
Nick Liu
6f8d6fff5b
Reindented tests/unit/e_formTest.php 2018-09-23 15:26:49 -05:00
Cameron
d622aa28a5 Test for XMLSiteLinks 2018-09-18 09:38:59 -07:00
Cameron
9209f912fa db-verify compare 2018-09-16 16:31:32 -07:00
Cameron
7bbf3164c7 Test for [img] bbcode in toHTML() 2018-09-12 13:21:19 -07:00
Nick Liu
c72b08616b
Refactored E107Base suite cleanup into "Preparer" classes
Now works with the best of both worlds:

* Barebones cleanup in slow Windows environments
* Git snapshots in other Git environments
2018-09-12 12:54:15 -05:00
Cameron
124381f5e7 Merge branch 'master' of https://github.com/e107inc/e107-test 2018-09-11 14:16:29 -07:00
Cameron
4245ff138d Work in Progress. 2018-09-11 14:16:10 -07:00
Nick Liu
11448a4a9f
Fixed possible fatal error in e107Test 2018-09-11 16:14:01 -05:00
Cameron
0fca5840f2 Disabled VCS modification. Added fixed hash folder name and cleanup before/after tests. 2018-09-09 18:20:20 -07:00
Cameron
5b9e2572a4 Test fixes. 2018-09-09 10:18:19 -07:00
Nick Liu
8f38794e14
Merge branch 'master' of github.com:e107inc/e107-test 2018-09-09 01:18:48 -05:00
Nick Liu
3af03f1f5e
Greatly improved robustness of E107Base
Fixed irreversible data loss bug when preparing the app path repo
for tests

OLD BEHAVIOR
Remove untracked files from the working tree before and after
every test suite. The intention was to remove files that could
have been created by the tests, but this also removes all other
untracked files, including third-party plugins and themes.

NEW BEHAVIOR
There is now a triple locking mechanism protecting the state of
the app repository before tests are run so that after tests have
run, all file contents are restored to how they were before the
tests have run.

There are three locks, each guarding a different part of the
original repo:

* file
* commit
* stash

When the file lock is present, E107Base knows that any other file,
tracked, untracked, or ignored, was created by the tested code.

The file lock is checked into the commit lock, which saves all
tracked and untracked files in the form of a commit. This way,
uncommitted code can be tested without manually making a commit that
includes the untracked files.

The stash lock saves all ignored files in a Git stash. Ignored files
go in a stash instead of in the commit lock because they can be a
confounding variable affecting the outcome of tests. They are usually
user-configurable only and may not represent tested states.

When the saving is complete, E107Base will have access to tracked and
untracked files but not ignored files. The tests are run in this
configuration.

After each test suite runs, the repo is reset and cleaned to return
the files to the same state they were in before the test suite began.

Then, the locks are undone first by rolling back the commit lock,
which restores the originally uncommitted tracked and untracked
files. Next, the stash lock is popped, restoring the originally
ignored files. Finally, the file lock is removed, signifying that the
repo is back to its original data before the test suite was run.

In case of an ungraceful exit, at least one of the locks would be
left in the repo. The next time E107Base runs, locks are checked, and
if one or more are present, the repo is restored before the locks are
reestablished.

If the `git` command is inoperative, only the file lock is operative
and does nothing more than signify a test that is in progress or has
exited unexpectedly. Data protection is silently unenforced. This can
lead to unexpected tracked, untracked, and ignored file modifications
that will not be rolled back after a test suite has run.
2018-09-09 01:18:09 -05:00
Cameron
bc29ef1efe Removed buggy value unserialize test. 2018-09-08 13:44:07 -07:00
Cameron
aef5a04e00 More admin-ui tests and separate inline checks. (very basic right now) 2018-09-04 15:26:29 -07:00
Nick Liu
5a8e4e166f
Initial integration with GitLab CI 2018-08-29 15:58:17 -05:00
Nick L
fc96dd5281
Merge pull request #12 from SimSync/fix_11
fixes #11 Typo in assertEquals
2018-08-27 09:58:28 -05:00
Achim Ennenbach
4fca8150d0 fixes #11 Typo in assertEquals 2018-08-27 15:39:59 +02:00
Cameron
7c7f636f3c Check TinyMce is installed after installations. 2018-08-25 15:32:11 -07:00
Cameron
71cca7bc86 Merge branch 'master' of https://github.com/e107inc/e107-test 2018-08-24 13:01:27 -07:00
Cameron
8d56b1ef2f Added tests for admin URL content. (to be completed) 2018-08-24 12:52:57 -07:00
Nick Liu
c94bbd8e14
More detailed assertion fail message in e_fileTest 2018-08-24 12:58:19 -05:00
Cameron
6914d035fb Fixed file_size_decode test. Added simple TinyMce parser test. 2018-08-22 09:48:47 -07:00
Cameron
ceab083b5e file_size_decode() test added. 2018-08-20 13:48:29 -07:00
Cameron
ccd877d09d Search test class placeholder added. Simple table parsing test added to db_verify test. 2018-08-17 13:56:35 -07:00
Nick Liu
6de885cd79
Updated documentation and renamed "cpanel" section to "hosting" 2018-08-16 09:15:47 -05:00
Nick Liu
ee7808b7bf
Major improvements to Deployer system (backwards-incompatible)
Deployers, a concept unique to this repository, are now more separated
from Codeception modules.

This commit adds NoopDeployer, LocalDeployer, and SFTPDeployer to
address the three deployment target types in use by testers today.

The changes are backwards-incompatible because the structure of
config.sample.yml has changed, and all testers need to change their
config.yml or config.local.yml to continue testing. The reason for this
change is that the section "manual" no longer makes sense now that
Deployers are on a spectrum of automation levels.

The subsections under "manual" have been broken out into the root level.

The "db_dump" section has been merged into the new "db" root section.

There is a new "fs" root section used by the SFTP Deployer.

Other changes, enhancements, and bugfixes:

* cPanelDeployer no longer downgrades to "manual" mode when credentials
  are missing or an unsupported component is requested. It now throws an
  exception.
* Deployer::unlinkAppFile() was implemented for acceptance tests out of
  necessity because the app requires a configuration file to be deleted
  before re-running the app's installer.
* If a Deployer subclass does not implement the unlinkAppFile() method,
  tests that depend on the method will be skipped gracefully.
* DeployerFactory now has a better autoload mechanism.
* A logical error in lib/config.php prevented missing nested array items
  from using their default values.
* The Base Helper no longer pointlessly caches the DelayedDb module
* _bootstrap.php serializes the config.yml params into a global constant
  so that the DeployerFactory can freely access the information.
2018-08-15 23:04:59 -05:00
Nick Liu
b440ab7274
Merge branch 'master' of github.com:e107inc/e107-test 2018-08-15 17:09:46 -05:00
Cameron
5e5a13cc62 Added check for Custom-fields 'boostrap3' install.xml data. 2018-08-14 17:07:56 -07:00
Nick Liu
b5b59392eb
Started a basic interface to manipulate files in acceptance tests
- MOD: Renamed lib/deployers/cpanel_deployer.php to
       lib/deployers/cPanelDeployer.php
- MOD: Moved responsibility of reconfiguring Codeception modules to the
       deployers.
- NEW: Abstract class Deployer to standardize the interface to Deployers
- NEW: Acceptance tests now support unlinkE107ConfigFromTestEnvironment
- MOD: Removed null checks for the Deployer in the Base Module
- MOD: Improved public method naming in the Base Module
- MOD: DeployerFactory always returns a Deployer implementation now.
- MOD: InstallCest always clears out the e107_config.php file before
       each test.
2018-08-14 16:03:30 -05:00
Cameron
58cd6f1c05 basic custom-fields test added. 2018-08-13 15:03:56 -07:00