Commit Graph

61 Commits

Author SHA1 Message Date
raviks789 33b6c01fe2 Create fake session to write csp nonces to it
`Csp::createnonces()` writes to a window aware session and hence a fake base session
is created in `BaseTestCase::setUp()` method
2023-08-28 16:56:51 +02:00
Johannes Meyer 82d39be642 BaseTestCase: Refactor request and response mocking 2023-07-04 17:05:06 +02:00
Johannes Meyer 08bfc4f596 BaseTestCase: Drop timezone setup, the app will do it 2023-07-04 17:05:06 +02:00
Johannes Meyer 531479a92e BaseTestCase: Deprecate directory properties 2023-07-04 17:05:06 +02:00
Johannes Meyer 3f447cb954 BaseTestCase: Remove `t` and `mt` function declarations 2023-07-04 17:05:06 +02:00
Johannes Meyer 0803a1bbdc test: Support multiple paths in `ICINGAWEB_MODULES_DIR` 2023-01-18 12:07:11 +01:00
Sukhwinder Dhillon 8f0ac0492d Replace deprecated method `DbConnection::getConnection()` with `DbConnection::getDbAdapter()` 2022-06-14 14:24:30 +02:00
Johannes Meyer f363bf5bf6 BaseTestCase: Setup `ipl\I18n\StaticTranslator::$instance` 2021-05-28 14:03:36 +02:00
Johannes Meyer e671324ddb tests: Don't use deprecated assertion `assertRegExp()` 2021-04-09 12:38:43 +02:00
Johannes Meyer bc1c967dec BaseTestCase: Inherit from `Mockery\Adapter\Phpunit\MockeryTestCase` 2021-04-09 12:38:43 +02:00
Johannes Meyer cb87190138 tests: Add `:void` return type declarations 2021-04-09 12:38:43 +02:00
Johannes Meyer eb674509b4 BaseTestCase: Read db host and port from env vars if available 2020-01-21 14:13:15 +01:00
Johannes Meyer 73e24302c0 Make running unittests with the icingacli work in package installations
fixes #2787
2017-03-09 11:36:35 +01:00
Johannes Meyer 181e2ef05c Swag: Fix swag (aka a whole bunch of code style issues..) 2017-01-27 14:48:59 +01:00
Alexander A. Klimov 474803fee4 Change all license headers to only reflect a file's year of creation
refs #11000
2016-02-08 15:41:00 +01:00
Eric Lippmann 8f8d251fd7 Use old class loader for tests (WIP)
:D
2015-11-13 17:33:23 +01:00
Eric Lippmann eb30ecd776 Revert "Fix failing search dashboard test"
This reverts commit 7c0dbe0077f56aef5f2a744761b47a0715dd591a.

Fixed by using t() in the SearchDashboard already.
2015-08-27 12:58:56 +02:00
Eric Lippmann 176177d874 Fix failing search dashboard test 2015-08-27 12:58:56 +02:00
Eric Lippmann 9060e8a034 lib: Only call Icinga::app()->getRequest() for getting the request outside of a controller
Saves a call to getFrontController().

refs #9660
2015-07-30 14:02:44 +02:00
Eric Lippmann 47925d0fa0 lib: Make BaseTestCase abstract
Else phpunit tries to run the "test" though it shouldn't :)
2015-07-28 13:58:23 +02:00
Eric Lippmann 1d6ef5ec3a Don't setup the DateTimeFactory in our tests
DateTimeFactory will be removed soon.

refs #6778
2015-05-19 11:25:06 +02:00
Eric Lippmann 6bae2e0a53 Note that our license is GPL v2 or any later version in our license header instead of pointing to the license's URL 2015-02-04 10:52:27 +01:00
Eric Lippmann 5b4fab0750 Add license header
This time without syntax errors hopefully :)
2015-02-03 16:27:59 +01:00
Eric Lippmann 5fa2e3cfdc Revert "Add license header"
This reverts commit 338d067aba.
2015-02-03 16:16:26 +01:00
Eric Lippmann 338d067aba Add license header
fixes #7788
2015-02-03 15:51:04 +01:00
Eric Lippmann 7eab09c2a2 Tests: Fix ApplicationBootstrap mock 2014-11-18 16:06:39 +01:00
Johannes Meyer 7621f6642d Adjust usages of Icinga\Application\Config
refs #7147
2014-11-18 13:11:52 +01:00
Johannes Meyer 7b99b74ae1 Prefer Icinga\Application\Config instead of Zend_Config
refs #7147
2014-11-07 13:53:03 +01:00
Johannes Meyer 9d8f810e10 Icinga\Web\Request::getParam() should be mocked as well by default 2014-09-09 13:01:09 +02:00
Johannes Meyer d6377ca00c Return bootstrap mock when calling BaseTestCase::setupIcingaMock() 2014-09-09 10:19:51 +02:00
Johannes Meyer 34bbe6508a Remove form test functionality from BaseTestCase
BaseTestCase::createForm() is not required as the Form base class does
not have that much bloat anymore to have the need for a form factory.
2014-09-09 09:29:29 +02:00
Johannes Meyer 1137c010a8 Provide global request and response mocks
Prior to this change one had to overwrite setupIcingaMock or setUp to set
a specific mock as request or response. Now it is possible to do this for a
specific test without overwriting any method.
2014-09-09 09:24:38 +02:00
Johannes Meyer 1de2d0c14f Merge branch 'master' into bugfix/rebuild-form-builder-5525
Conflicts:
	application/forms/Authentication/LoginForm.php
	library/Icinga/Test/BaseTestCase.php
	library/Icinga/Web/Form.php
	library/Icinga/Web/Form/Decorator/BootstrapForm.php
2014-07-17 13:15:42 +02:00
Johannes Meyer e5fdf78c98 Fix testing errors due to accessing the session id by using our container 2014-07-16 10:18:00 +02:00
Johannes Meyer 3105c2059e Remove license headers from all files
refs #6309
2014-07-15 13:43:52 +02:00
Johannes Meyer 0dce204651 Refactor Icinga\Web\Form
We eagerly waited badly for a new approach to build forms, so here it is.
Should be the best compromise between the Zend_Form functionality and
our requirements regarding automatic submits.

refs #5525
2014-07-10 11:13:45 +02:00
Thomas Gelf db3accc704 Data\Db: rename Query and Connection to Db...
Class names in namespaces should not be chosen as once we didn't have
such. The fact that we already did "use Db\Connection as DbConnection"
is the best hint that naming was wrong.

So this patch renames Db\Connection to Db\DbConnection and does the
same with DbQuery. DbQuery has been adjusted to fit our new SimpleQuery
and to handle the new Filter implementation.
2014-06-06 06:43:13 +00:00
Marius Hein 6c698c1543 Tests: Remove Zend Controller Test from base test
fixes #6106
2014-05-02 09:46:01 +02:00
Johannes Meyer 07da92ee42 Rewrite test for Icinga\Web\Url and fix some bugs
refs #6011
2014-04-28 14:06:40 +02:00
Johannes Meyer 45d7864198 Refactor test for Icinga\Test\BaseTestCase
refs #6011
2014-04-28 14:06:39 +02:00
Johannes Meyer 891d36dbd7 Make DateTimeFactory expecting a string instead of a DateTimeZone 2014-04-28 14:06:39 +02:00
Johannes Meyer 1ed1c0bc3c Remove user auth and backend tests
refs #4639
2014-04-14 11:44:02 +02:00
Johannes Meyer a844d33735 Do not create alias mock for Icinga\Application\Icinga
refs #4639
2014-04-14 08:31:46 +02:00
Johannes Meyer 927772578d We do not want to use "@backupStaticAttributes enabled"
refs #4639
2014-04-11 15:31:29 +02:00
Johannes Meyer 1e69169bab Fix database tests
refs #4639
2014-04-10 11:33:24 +02:00
Johannes Meyer ccae70bc80 Make all tests inherit from BaseTestCase and fix license headers and style
refs #4639
2014-04-10 10:32:50 +02:00
Marius Hein 7708b9901f Drop BaseTestCase static class loader
refs #4639
2014-04-09 09:27:01 +02:00
Marius Hein 746cc4b5d9 Drop obsolete test cases
refs #4639
2014-04-09 09:26:11 +02:00
Eric Lippmann 08d7edebfc Decouple (automatic) preferences storage from user preferences (WIP)
DbStore, persisting preferences and tests not yet reworked.
2014-02-14 17:28:11 +01:00
Matthias Jentsch 59d4baff0b Fix remaining references to DbUserBackend and refresh the documentation.
refs #4786
2013-11-06 13:31:07 +01:00