786 Commits

Author SHA1 Message Date
Andrew Ruthven
146ab4d068 Update test results for database creation.
I've rebased onto master which has a new DB version.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
56d7d22d86 Rename mapping_field to user_mapping_field
This is to be consistent with group_mapping_field. The code is backwards
compatible with mapping_field.

In sync_LDAP_groups assign user_mapping once, not for every group.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
13083b07e8 Rename username to name in group mappings, drop unused fullname from example
Usinger "username" for the group name is confusing and misleading. Just
use name, but support our users who still have username.

We don't use fullname, drop it from the example.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
995fe296c4 All debug output goes to STDERR so not combined with test results 2024-02-17 02:25:25 +00:00
Andrew Ruthven
86cb62f404 is_head_request is only used once, simplify 2024-02-17 02:25:25 +00:00
Andrew Ruthven
b15c99fe1b Add tests for LDAP sync of users and groups. 2024-02-17 02:25:25 +00:00
Andrew Ruthven
30b05549d0 Remove tests related to memcache, add BPS to copyright
I re-used some of the test LDAP logic from the test suite of Request
Tracker by BPS.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
353a2d1b13 Add testing for LDAP with memcache 2024-02-17 02:25:25 +00:00
Andrew Ruthven
7898efdfda Add the ability to run Perl snippets
This allows for more complicated test suites, which I'll use in the next commit...
2024-02-17 02:25:25 +00:00
Andrew Ruthven
9dc52a5e25 Updates to other tests as side effects of adding room1 and room2 principals 2024-01-21 19:12:42 +13:00
Andrew Ruthven
1ca8284bdc Add ROOM as a principal type
This hopefully resolves #282.
2024-01-21 19:12:42 +13:00
Andrew Ruthven
ecda4395e8 Update to reflect change in tests 2024-01-19 19:49:02 +13:00
Andrew Ruthven
f137dd788e Update test to straddle the DST change
As pointed out in
https://gitlab.com/davical-project/davical/-/merge_requests/86#note_1209576949
the issue is when events straddle the DST change.
2024-01-19 19:48:03 +13:00
Andrew Ruthven
ff403b84a9 Update ETag, why?! 2024-01-19 19:13:07 +13:00
Andrew Ruthven
5ef5c756f8 Tests to try and tickle an issue raised in MR 86
However, the result is what it should be? Interesting.

https://gitlab.com/davical-project/davical/-/merge_requests/86
2024-01-19 19:13:07 +13:00
Andrew Ruthven
3d2e3d9f12 Move the CSP to only apply to DAViCal htdocs 2023-10-23 18:22:53 +13:00
Andrew Ruthven
aaa70a83f8 Remove sis.redsys.es from CSP
As raised in https://sourceforge.net/p/davical/mailman/message/47766326/
2023-10-23 17:56:54 +13:00
Athos Ribeiro
0502860a95 Add support for phpunit 10
In phpunit 10, global states are no longer preserved by default [1].

* https://bugs.debian.org/1039746

[1] https://github.com/sebastianbergmann/phpunit/blob/10.0.0/ChangeLog-10.0.md#changed
2023-07-06 16:28:53 -03:00
Andrew Ruthven
6ac6b30c7a Additional record to CONFIDENTIAL resources
Update due to 5ab4f4391406bda5a6f1bc7b2288844bb6fefa06
2023-05-02 10:44:52 +00:00
Andrew Ruthven
720eb89adb Add tests for checking that CONFIDENTIAL resources include all recurrance information
This is to tickle #291. The only test that is actually required is
2603-GET-resource-confidential, but I want to make sure all the options were
correct.

In this commit 2603-GET-resource-confidential is expected to fail.
2023-05-02 10:44:52 +00:00
Andrew Ruthven
d4b91f2627 Set UNTIL for some RRULEs
This is to get these events out of the way for some new tests.
2023-05-02 10:44:52 +00:00
Andrew Ruthven
fdf58827e3 Allow enabling debugging via environment variable 2023-05-02 00:12:48 +12:00
Florian Schlichting
effc004741 use "." to concatenate strings, not "+" (fixes #288)
Unsupported operand types: string + string at /usr/share/davical/inc/caldav-ACL.php:146
2023-03-23 22:17:23 +01:00
Florian Schlichting
477425f3fe Fix phpunit tests ('Attempt to read property "rrule_loop_limit" on null') and add them to 'make test' 2023-03-13 21:56:13 +01:00
Andrew Ruthven
b40c96debb If time-range is set, only return matching events.
Closes #280
2023-03-12 20:19:10 +01:00
Andrew Ruthven
15d01c8bed Store DTSTART and DTEND from user in shadow columns
We want to store the calculated dtstart and dtend in the database so we can
use SQL to fetch records. However, we also need what the user sent us so we
can allow prop-filters to be used as well.

So we store what the user sends us in dtstart_orig and dtend_orig and only
use for relevant prop-filter reports.
2023-03-12 20:17:43 +01:00
Andrew Ruthven
5a73991496 DTSTART on VTODO is optional, don't force it to be set.
If we force setting DTSTART, then you can't use prop-filter to find VTODOs
with a DUE set and DTSTART unset. And, well, why should DTSTART be set to DUE?

This was introduced in 18150d702d91fa1a687801baa582d967e79fff8d .
2023-03-12 20:05:48 +01:00
Andrew Ruthven
badeca53c7 Update tests that check for CLASS in the database.
We no longer force CLASS to be PUBLIC in the database if it isn't set.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
149ec3555f CLASS is an optional field, don't set it to PUBLIC
As specified in RFC5545 the CLASS field is optional, and if it isn't present
is treated as PUBLIC. To allow a is-not-defined prop-filter to find
resources without CLASS set, we need to not store in the database. This
turns out to be okay, because to enforce privacy we always check to see if
it is PRIVATE or CONFIDENTIAL. We never check to see if it is PUBLIC.

Closes #284.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
4a380b12a2 Fixes to is-defined and is-not-defined prop-filter
Gosh, this was completely broken previously. A number of different scenarios now work.

I have used some of the state I've seen in a largish production database with the
presence of NULL and empty strings. I've assumed that empty string should be treated
as is-not-defined. Happy to be talked out of that.

Closes #281.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
6819d6d7d1 Add a primary_key to the addressbook_addresses_* tables
This is part of the fix for #276.
2023-02-15 07:42:34 +00:00
Andrew Ruthven
c3970f3be2 Fix RRULE for BYHOUR, BYMINUTE and BYSECOND
Closes #283.
2023-02-15 07:28:35 +00:00
Andrew Ruthven
be60ec1778 Improve on SQL syntax fix to keep logging working, and add regression test.
Closes #279.
2023-02-04 03:09:40 +00:00
Andrew Ruthven
ad1be4b640 Add CI for memcache 2023-01-18 00:11:57 +13:00
Andrew Ruthven
c9ac75173b Allow the tester to hit N or n to continue 2023-01-08 12:13:32 +13:00
Andrew Ruthven
a323ba8dae Don't change the day of the month to 28, if it is > 28
Gosh. The logic was saying, if the modified date has a day of the
month > 28, change it to 28. Which is rather odd. Don't do that.

This closes #248. It also fixes a bug with FREQ=MONTHLY;BYMONTHDAY=-1
as it turns out.
2022-12-18 13:52:48 +13:00
Andrew Ruthven
7d0e2f2435 Test Free/Busy results for MONTHLY with BYMONTHDAY
Tests https://gitlab.com/davical-project/davical/-/issues/248
2022-12-18 13:52:48 +13:00
Andrew Ruthven
64f47fd9e6 Tests for MONTHLY recurrence where DTSTART is on the 29th of Feb
Each of the recurring events should also be on the 29th. Currently
these tests fail as the generated events are on the 28th. Oops.
2022-12-18 13:52:48 +13:00
Andrew Ruthven
7b2fa34f73 Reenable N being a default 2022-12-17 22:01:03 +13:00
Andrew Ruthven
45c74a628b Improvements to run_regressions.sh options
* Add q to quit
* Loop if an invalid command is entered, instead of continuing

As part of this I converted the large if/elif/elif/.../fi to a case
statement, a bit easier to read.
2022-12-17 15:40:06 +13:00
Andrew Ruthven
80102c2700 initial tests for issue 268 2022-12-15 20:50:44 +00:00
Andrew Ruthven
0750dd27a1 Another test result to update 2022-12-15 15:09:17 +13:00
Andrew Ruthven
3c1d39ff85 Ensure the test suite exists before operating on it.
I kept on making typos, so ended up with random directories, this should
stop that from happening in future.
2022-12-14 23:58:49 +13:00
Andrew Ruthven
fc09febad2 Update tests now that we don't inherit the DB from previous directory 2022-12-14 09:52:35 +13:00
Andrew Ruthven
692c20eec6 Don't inherit DB from previous test set 2022-12-14 08:53:32 +13:00
Andrew Ruthven
7d2bbeb37c Update regression tests that hit index.php for new CSP 2022-12-13 12:57:41 +13:00
Andrew Ruthven
ffe5ed24ad Add Content-Security-Policy header to sample Apache2 config files
We now support running with a strict self CSP, let's provide that!
2022-12-13 12:57:41 +13:00
Andrew Ruthven
aab8ddfd30 Ensure that all fields are defined, not added dynamically.
PHP 8.2 deprecates dynmically adding properties. See:
  https://php.watch/versions/8.2/dynamic-properties-deprecated
2022-12-10 14:37:31 +13:00
Andrew Ruthven
8162b9f850 Ensure that propfind for access is deterministic.
I noticed that the ordering of principals returned wasn't deterministic
for tests. Ensure it is.
2022-12-10 02:04:27 +13:00
Florian Schlichting
f44a996432 do not report VTODO in freebusy (fixes: #267)
RFC 4791 clearly states in 7.10:
    Only VEVENT components without a TRANSP property or with the TRANSP
    property set to OPAQUE, and VFREEBUSY components SHOULD be considered
    in generating the free busy time information.

Looking at fa67ef987e, this used to be VFREEBUSY until the refactoring, and
0886-REPORT-freebusy.test still had that.

Apparently we're not (yet) considering VAVAILABILITY (RFC 7953) here.
2022-10-04 08:47:53 +02:00