diff --git a/tests/Sabre/DAVServerTest.php b/tests/Sabre/AbstractDAVServerTestCase.php similarity index 96% rename from tests/Sabre/DAVServerTest.php rename to tests/Sabre/AbstractDAVServerTestCase.php index d9908be822..40dcb41dfa 100644 --- a/tests/Sabre/DAVServerTest.php +++ b/tests/Sabre/AbstractDAVServerTestCase.php @@ -4,6 +4,10 @@ namespace Sabre; +use PHPUnit\Framework\TestCase; +use Sabre\CalDAV\SharingPlugin; +use Sabre\DAV\Server; +use Sabre\DAV\Sharing\Plugin; use Sabre\HTTP\Request; use Sabre\HTTP\Response; @@ -17,7 +21,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -abstract class DAVServerTest extends \PHPUnit\Framework\TestCase +abstract class AbstractDAVServerTestCase extends TestCase { protected $setupCalDAV = false; protected $setupCardDAV = false; @@ -43,7 +47,7 @@ abstract class DAVServerTest extends \PHPUnit\Framework\TestCase protected $carddavCards = []; /** - * @var \Sabre\DAV\Server + * @var Server */ protected $server; protected $tree = []; @@ -70,7 +74,7 @@ abstract class DAVServerTest extends \PHPUnit\Framework\TestCase protected $aclPlugin; /** - * @var \Sabre\CalDAV\SharingPlugin + * @var SharingPlugin */ protected $caldavSharingPlugin; @@ -99,7 +103,7 @@ abstract class DAVServerTest extends \PHPUnit\Framework\TestCase /** * Sharing plugin. * - * @var \Sabre\DAV\Sharing\Plugin + * @var Plugin */ protected $sharingPlugin; @@ -190,10 +194,10 @@ public function initializeEverything() * the returned response. If it doesn't match, we'll immediately fail * the test. * - * @param array|\Sabre\HTTP\Request $request - * @param int $expectedStatus + * @param array|Request $request + * @param int $expectedStatus * - * @return \Sabre\HTTP\Response + * @return Response */ public function request($request, $expectedStatus = null) { diff --git a/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php similarity index 93% rename from tests/Sabre/CalDAV/Backend/AbstractPDOTest.php rename to tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php index 769d215264..f25773e00f 100644 --- a/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php +++ b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php @@ -4,12 +4,16 @@ namespace Sabre\CalDAV\Backend; +use DateTime; +use PHPUnit\Framework\TestCase; use Sabre\CalDAV; use Sabre\DAV; use Sabre\DAV\PropPatch; +use Sabre\DAV\Sharing\Plugin; use Sabre\DAV\Xml\Element\Sharee; +use Sabre\DAV\Xml\Property\Href; -abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPDOTestCase extends TestCase { use DAV\DbTestHelperTrait; @@ -64,7 +68,7 @@ public function testCreateCalendarAndFetch() '{DAV:}displayname' => 'Hello!', '{urn:ietf:params:xml:ns:caldav}calendar-description' => '', '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'), - 'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, + 'share-access' => Plugin::ACCESS_SHAREDOWNER, ]; self::assertIsArray($calendars); @@ -765,8 +769,8 @@ public function testCalendarQueryTimeRange() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new \DateTime('20120103'), - 'end' => new \DateTime('20120104'), + 'start' => new DateTime('20120103'), + 'end' => new DateTime('20120104'), ], ], ], @@ -796,7 +800,7 @@ public function testCalendarQueryTimeRangeEndNull() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new \DateTime('20120102'), + 'start' => new DateTime('20120102'), 'end' => null, ], ], @@ -827,7 +831,7 @@ public function testCalendarQueryTimeRangeNoEnd() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new \DateTime('20120102'), + 'start' => new DateTime('20120102'), ], ], ], @@ -857,7 +861,7 @@ public function testCalendarQueryTimeRangeNoStart() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'end' => new \DateTime('20120102'), + 'end' => new DateTime('20120102'), ], ], ], @@ -991,7 +995,7 @@ public function testGetChangesBadId() public function testCreateSubscriptions() { $props = [ - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal.ics'), '{DAV:}displayname' => 'cal', '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', @@ -1032,7 +1036,7 @@ public function testCreateSubscriptionFail() public function testUpdateSubscriptions() { $props = [ - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal.ics'), '{DAV:}displayname' => 'cal', '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', @@ -1046,7 +1050,7 @@ public function testUpdateSubscriptions() $newProps = [ '{DAV:}displayname' => 'new displayname', - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal2.ics'), ]; $propPatch = new DAV\PropPatch($newProps); @@ -1074,7 +1078,7 @@ public function testUpdateSubscriptions() public function testUpdateSubscriptionsFail() { $props = [ - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal.ics'), '{DAV:}displayname' => 'cal', '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', @@ -1088,7 +1092,7 @@ public function testUpdateSubscriptionsFail() $propPatch = new DAV\PropPatch([ '{DAV:}displayname' => 'new displayname', - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal2.ics'), '{DAV:}unknown' => 'foo', ]); @@ -1105,7 +1109,7 @@ public function testUpdateSubscriptionsFail() public function testDeleteSubscriptions() { $props = [ - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal.ics'), '{DAV:}displayname' => 'cal', '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', @@ -1119,7 +1123,7 @@ public function testDeleteSubscriptions() $newProps = [ '{DAV:}displayname' => 'new displayname', - '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics'), + '{http://calendarserver.org/ns/}source' => new Href('http://example.org/cal2.ics'), ]; $backend->deleteSubscription(1); @@ -1213,8 +1217,8 @@ public function testGetInvites() new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]), ]; @@ -1250,8 +1254,8 @@ public function testUpdateInvites() $ownerSharee = new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]); // Add a new invite @@ -1261,8 +1265,8 @@ public function testUpdateInvites() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READ, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, 'properties' => ['{DAV:}displayname' => 'User 2'], ]), ] @@ -1274,8 +1278,8 @@ public function testUpdateInvites() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READ, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, 'properties' => [ '{DAV:}displayname' => 'User 2', ], @@ -1289,7 +1293,7 @@ public function testUpdateInvites() 'principaluri' => 'principals/user2', '{http://calendarserver.org/ns/}getctag' => 'http://sabre.io/ns/sync/1', '{http://sabredav.org/ns}sync-token' => '1', - 'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, + 'share-access' => Plugin::ACCESS_READ, 'read-only' => true, 'share-resource-uri' => '/ns/share/1', ]; @@ -1310,8 +1314,8 @@ public function testUpdateInvites() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READWRITE, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]), ] ); @@ -1322,8 +1326,8 @@ public function testUpdateInvites() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READWRITE, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, 'properties' => [ '{DAV:}displayname' => 'User 2', ], @@ -1337,7 +1341,7 @@ public function testUpdateInvites() [ new Sharee([ 'href' => 'mailto:user@example.org', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS, + 'access' => Plugin::ACCESS_NOACCESS, ]), ] ); @@ -1354,7 +1358,7 @@ public function testUpdateInvites() [ new Sharee([ 'href' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS, + 'access' => Plugin::ACCESS_NOACCESS, ]), ] ); @@ -1364,8 +1368,8 @@ public function testUpdateInvites() new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]), ]; self::assertEquals($expected, $result); @@ -1399,8 +1403,8 @@ public function testUpdateInvitesNoPrincipal() $ownerSharee = new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]); // Add a new invite @@ -1410,8 +1414,8 @@ public function testUpdateInvitesNoPrincipal() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => null, - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READ, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, 'properties' => ['{DAV:}displayname' => 'User 2'], ]), ] @@ -1423,8 +1427,8 @@ public function testUpdateInvitesNoPrincipal() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => null, - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_INVALID, + 'access' => Plugin::ACCESS_READ, + 'inviteStatus' => Plugin::INVITE_INVALID, 'properties' => [ '{DAV:}displayname' => 'User 2', ], @@ -1447,8 +1451,8 @@ public function testDeleteSharedCalendar() $ownerSharee = new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]); // Add a new invite @@ -1458,8 +1462,8 @@ public function testDeleteSharedCalendar() new Sharee([ 'href' => 'mailto:user@example.org', 'principal' => 'principals/user2', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_READ, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, 'properties' => ['{DAV:}displayname' => 'User 2'], ]), ] @@ -1470,7 +1474,7 @@ public function testDeleteSharedCalendar() 'principaluri' => 'principals/user2', '{http://calendarserver.org/ns/}getctag' => 'http://sabre.io/ns/sync/1', '{http://sabredav.org/ns}sync-token' => '1', - 'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ, + 'share-access' => Plugin::ACCESS_READ, 'read-only' => true, 'share-resource-uri' => '/ns/share/1', ]; @@ -1497,8 +1501,8 @@ public function testDeleteSharedCalendar() new Sharee([ 'href' => 'principals/user1', 'principal' => 'principals/user1', - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER, - 'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, + 'access' => Plugin::ACCESS_SHAREDOWNER, + 'inviteStatus' => Plugin::INVITE_ACCEPTED, ]), ]; self::assertEquals($expected, $result); diff --git a/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php b/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php index 66388def4f..d0ba2f31a0 100644 --- a/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php +++ b/tests/Sabre/CalDAV/Backend/PDOMySQLTest.php @@ -4,7 +4,7 @@ namespace Sabre\CalDAV\Backend; -class PDOMySQLTest extends AbstractPDOTest +class PDOMySQLTest extends AbstractPDOTestCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/CalDAV/Backend/PDOPgSqlTest.php b/tests/Sabre/CalDAV/Backend/PDOPgSqlTest.php index feffedfa49..30d26695c0 100644 --- a/tests/Sabre/CalDAV/Backend/PDOPgSqlTest.php +++ b/tests/Sabre/CalDAV/Backend/PDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\CalDAV\Backend; -class PDOPgSqlTest extends AbstractPDOTest +class PDOPgSqlTest extends AbstractPDOTestCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php b/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php index 4470e58109..e645aef926 100644 --- a/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php +++ b/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\CalDAV\Backend; -class PDOSqliteTest extends AbstractPDOTest +class PDOSqliteTest extends AbstractPDOTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php index 77714f0aae..94fa3559b7 100644 --- a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php +++ b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ExpandEventsDTSTARTandDTENDTest extends \Sabre\DAVServerTest +class ExpandEventsDTSTARTandDTENDTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php index fe4691e33f..00d629aaa3 100644 --- a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php +++ b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ExpandEventsDTSTARTandDTENDbyDayTest extends \Sabre\DAVServerTest +class ExpandEventsDTSTARTandDTENDbyDayTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php b/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php index acbf05c7db..21583ef5d3 100644 --- a/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php +++ b/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php @@ -17,7 +17,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ExpandEventsDoubleEventsTest extends \Sabre\DAVServerTest +class ExpandEventsDoubleEventsTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/ExpandEventsFloatingTimeTest.php b/tests/Sabre/CalDAV/ExpandEventsFloatingTimeTest.php index 2251c7e5d1..b59e10f567 100644 --- a/tests/Sabre/CalDAV/ExpandEventsFloatingTimeTest.php +++ b/tests/Sabre/CalDAV/ExpandEventsFloatingTimeTest.php @@ -11,7 +11,7 @@ * This unittest is created to check if expand() works correctly with * floating times (using calendar-timezone information). */ -class ExpandEventsFloatingTimeTest extends \Sabre\DAVServerTest +class ExpandEventsFloatingTimeTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php index 0e265f38bb..02a5f800bb 100644 --- a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php +++ b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php @@ -13,7 +13,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class GetEventsByTimerangeTest extends \Sabre\DAVServerTest +class GetEventsByTimerangeTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/ICSExportPluginTest.php b/tests/Sabre/CalDAV/ICSExportPluginTest.php index b90a0eac44..6119c7624e 100644 --- a/tests/Sabre/CalDAV/ICSExportPluginTest.php +++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php @@ -9,7 +9,7 @@ use Sabre\HTTP; use Sabre\VObject; -class ICSExportPluginTest extends \Sabre\DAVServerTest +class ICSExportPluginTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/Issue203Test.php b/tests/Sabre/CalDAV/Issue203Test.php index 902bab0ac9..580f159907 100644 --- a/tests/Sabre/CalDAV/Issue203Test.php +++ b/tests/Sabre/CalDAV/Issue203Test.php @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Issue203Test extends \Sabre\DAVServerTest +class Issue203Test extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/Issue205Test.php b/tests/Sabre/CalDAV/Issue205Test.php index 67611c5868..354f4978bb 100644 --- a/tests/Sabre/CalDAV/Issue205Test.php +++ b/tests/Sabre/CalDAV/Issue205Test.php @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Issue205Test extends \Sabre\DAVServerTest +class Issue205Test extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/Issue211Test.php b/tests/Sabre/CalDAV/Issue211Test.php index b9a103d3c7..e319285df3 100644 --- a/tests/Sabre/CalDAV/Issue211Test.php +++ b/tests/Sabre/CalDAV/Issue211Test.php @@ -13,7 +13,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Issue211Test extends \Sabre\DAVServerTest +class Issue211Test extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/Issue220Test.php b/tests/Sabre/CalDAV/Issue220Test.php index 5ad3ebe917..a4c62fac8d 100644 --- a/tests/Sabre/CalDAV/Issue220Test.php +++ b/tests/Sabre/CalDAV/Issue220Test.php @@ -13,7 +13,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Issue220Test extends \Sabre\DAVServerTest +class Issue220Test extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/Issue228Test.php b/tests/Sabre/CalDAV/Issue228Test.php index 9e88251c7c..bd9e87d66d 100644 --- a/tests/Sabre/CalDAV/Issue228Test.php +++ b/tests/Sabre/CalDAV/Issue228Test.php @@ -13,7 +13,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Issue228Test extends \Sabre\DAVServerTest +class Issue228Test extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; diff --git a/tests/Sabre/CalDAV/JCalTransformTest.php b/tests/Sabre/CalDAV/JCalTransformTest.php index 605f980198..de4d467b87 100644 --- a/tests/Sabre/CalDAV/JCalTransformTest.php +++ b/tests/Sabre/CalDAV/JCalTransformTest.php @@ -7,7 +7,7 @@ use Sabre\HTTP\Request; use Sabre\VObject; -class JCalTransformTest extends \Sabre\DAVServerTest +class JCalTransformTest extends \Sabre\AbstractDAVServerTestCase { use VObject\PHPUnitAssertions; diff --git a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php index 5fa6120ad8..10d6153739 100644 --- a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php +++ b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php @@ -7,7 +7,7 @@ use Sabre\HTTP\Request; use Sabre\VObject; -class DeliverNewEventTest extends \Sabre\DAVServerTest +class DeliverNewEventTest extends \Sabre\AbstractDAVServerTestCase { public $setupCalDAV = true; public $setupCalDAVScheduling = true; diff --git a/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php b/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php index 6e53abc700..b4e298efef 100644 --- a/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php +++ b/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class OutboxPostTest extends \Sabre\DAVServerTest +class OutboxPostTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; protected $setupACL = true; diff --git a/tests/Sabre/CalDAV/Schedule/PluginBasicTest.php b/tests/Sabre/CalDAV/Schedule/PluginBasicTest.php index 083d141153..8817b030d7 100644 --- a/tests/Sabre/CalDAV/Schedule/PluginBasicTest.php +++ b/tests/Sabre/CalDAV/Schedule/PluginBasicTest.php @@ -4,7 +4,7 @@ namespace Sabre\CalDAV\Schedule; -class PluginBasicTest extends \Sabre\DAVServerTest +class PluginBasicTest extends \Sabre\AbstractDAVServerTestCase { public $setupCalDAV = true; public $setupCalDAVScheduling = true; diff --git a/tests/Sabre/CalDAV/Schedule/PluginPropertiesTest.php b/tests/Sabre/CalDAV/Schedule/PluginPropertiesTest.php index 6fed3ee4f2..73ceb788d0 100644 --- a/tests/Sabre/CalDAV/Schedule/PluginPropertiesTest.php +++ b/tests/Sabre/CalDAV/Schedule/PluginPropertiesTest.php @@ -6,7 +6,7 @@ use Sabre\DAV; -class PluginPropertiesTest extends \Sabre\DAVServerTest +class PluginPropertiesTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; protected $setupCalDAVScheduling = true; diff --git a/tests/Sabre/CalDAV/Schedule/PluginPropertiesWithSharedCalendarTest.php b/tests/Sabre/CalDAV/Schedule/PluginPropertiesWithSharedCalendarTest.php index 0388d0b0ee..7ece1edd1e 100644 --- a/tests/Sabre/CalDAV/Schedule/PluginPropertiesWithSharedCalendarTest.php +++ b/tests/Sabre/CalDAV/Schedule/PluginPropertiesWithSharedCalendarTest.php @@ -6,7 +6,7 @@ use Sabre\DAV; -class PluginPropertiesWithSharedCalendarTest extends \Sabre\DAVServerTest +class PluginPropertiesWithSharedCalendarTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; protected $setupCalDAVScheduling = true; diff --git a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php index 912ee3b854..8652339519 100644 --- a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php +++ b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php @@ -8,7 +8,7 @@ use Sabre\Uri; use Sabre\VObject; -class ScheduleDeliverTest extends \Sabre\DAVServerTest +class ScheduleDeliverTest extends \Sabre\AbstractDAVServerTestCase { use VObject\PHPUnitAssertions; diff --git a/tests/Sabre/CalDAV/SharingPluginTest.php b/tests/Sabre/CalDAV/SharingPluginTest.php index b8fac8b0c5..7a58656abd 100644 --- a/tests/Sabre/CalDAV/SharingPluginTest.php +++ b/tests/Sabre/CalDAV/SharingPluginTest.php @@ -4,12 +4,12 @@ namespace Sabre\CalDAV; +use Sabre\AbstractDAVServerTestCase; use Sabre\DAV; use Sabre\DAV\Xml\Element\Sharee; -use Sabre\DAVServerTest; use Sabre\HTTP; -class SharingPluginTest extends DAVServerTest +class SharingPluginTest extends AbstractDAVServerTestCase { protected $setupCalDAV = true; protected $setupCalDAVSharing = true; diff --git a/tests/Sabre/CalDAV/Subscriptions/CreateSubscriptionTest.php b/tests/Sabre/CalDAV/Subscriptions/CreateSubscriptionTest.php index 5c5ab5f558..5b2c1571fa 100644 --- a/tests/Sabre/CalDAV/Subscriptions/CreateSubscriptionTest.php +++ b/tests/Sabre/CalDAV/Subscriptions/CreateSubscriptionTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP\Request; -class CreateSubscriptionTest extends \Sabre\DAVServerTest +class CreateSubscriptionTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCalDAV = true; protected $setupCalDAVSubscriptions = true; diff --git a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php index 2e3d6e42ea..5399de709f 100644 --- a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php +++ b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\Xml\Writer; -class InviteTest extends DAV\Xml\XmlTest +class InviteTest extends DAV\Xml\AbstractXmlTestCase { /** * @param array $notification diff --git a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php index 75409dce2a..77d8851277 100644 --- a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php @@ -7,7 +7,7 @@ use Sabre\CalDAV; use Sabre\DAV; -class AllowedSharingModesTest extends DAV\Xml\XmlTest +class AllowedSharingModesTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php b/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php index b732b26c53..7fab3e6472 100644 --- a/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php @@ -4,9 +4,9 @@ namespace Sabre\CalDAV\Xml\Property; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class EmailAddressSetTest extends XmlTest +class EmailAddressSetTest extends AbstractXmlTestCase { protected $namespaceMap = [ \Sabre\CalDAV\Plugin::NS_CALENDARSERVER => 'cs', diff --git a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php index 11a26c28e3..309b28291c 100644 --- a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php @@ -9,7 +9,7 @@ use Sabre\DAV\Sharing\Plugin as SP; use Sabre\DAV\Xml\Element\Sharee; -class InviteTest extends DAV\Xml\XmlTest +class InviteTest extends DAV\Xml\AbstractXmlTestCase { public function setup(): void { diff --git a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php index fe6170146f..c2f76b8ae3 100644 --- a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php @@ -7,7 +7,7 @@ use Sabre\CalDAV; use Sabre\DAV; -class ScheduleCalendarTranspTest extends DAV\Xml\XmlTest +class ScheduleCalendarTranspTest extends DAV\Xml\AbstractXmlTestCase { public function setup(): void { diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php index 4be33a7959..9f60c40dd8 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php @@ -7,7 +7,7 @@ use Sabre\CalDAV; use Sabre\DAV; -class SupportedCalendarComponentSetTest extends DAV\Xml\XmlTest +class SupportedCalendarComponentSetTest extends DAV\Xml\AbstractXmlTestCase { public function setup(): void { diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php index 6a41a01965..51f558e178 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php @@ -7,7 +7,7 @@ use Sabre\CalDAV; use Sabre\DAV; -class SupportedCalendarDataTest extends DAV\Xml\XmlTest +class SupportedCalendarDataTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php index e4737b0cd4..a1f18342ec 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php @@ -7,7 +7,7 @@ use Sabre\CalDAV; use Sabre\DAV; -class SupportedCollationSetTest extends DAV\Xml\XmlTest +class SupportedCollationSetTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php index a7a03f976b..8172c906fe 100644 --- a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php @@ -6,9 +6,9 @@ use DateTimeImmutable; use DateTimeZone; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class CalendarQueryReportTest extends XmlTest +class CalendarQueryReportTest extends AbstractXmlTestCase { protected $elementMap = [ '{urn:ietf:params:xml:ns:caldav}calendar-query' => 'Sabre\\CalDAV\\Xml\\Request\CalendarQueryReport', diff --git a/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php b/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php index aea49fd219..baf07681d5 100644 --- a/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php @@ -5,9 +5,9 @@ namespace Sabre\CalDAV\Xml\Request; use Sabre\DAV; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class InviteReplyTest extends XmlTest +class InviteReplyTest extends AbstractXmlTestCase { protected $elementMap = [ '{http://calendarserver.org/ns/}invite-reply' => 'Sabre\\CalDAV\\Xml\\Request\\InviteReply', diff --git a/tests/Sabre/CalDAV/Xml/Request/ShareTest.php b/tests/Sabre/CalDAV/Xml/Request/ShareTest.php index 0ea00a8009..0d696f17b8 100644 --- a/tests/Sabre/CalDAV/Xml/Request/ShareTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/ShareTest.php @@ -4,10 +4,10 @@ namespace Sabre\CalDAV\Xml\Request; +use Sabre\DAV\Xml\AbstractXmlTestCase; use Sabre\DAV\Xml\Element\Sharee; -use Sabre\DAV\Xml\XmlTest; -class ShareTest extends XmlTest +class ShareTest extends AbstractXmlTestCase { protected $elementMap = [ '{http://calendarserver.org/ns/}share' => 'Sabre\\CalDAV\\Xml\\Request\\Share', diff --git a/tests/Sabre/CardDAV/AbstractPluginTest.php b/tests/Sabre/CardDAV/AbstractPluginTestCase.php similarity index 76% rename from tests/Sabre/CardDAV/AbstractPluginTest.php rename to tests/Sabre/CardDAV/AbstractPluginTestCase.php index 6565fc4592..6d5e588cd3 100644 --- a/tests/Sabre/CardDAV/AbstractPluginTest.php +++ b/tests/Sabre/CardDAV/AbstractPluginTestCase.php @@ -4,22 +4,24 @@ namespace Sabre\CardDAV; -use Sabre\DAV; +use PHPUnit\Framework\TestCase; +use Sabre\CardDAV\Backend\Mock; +use Sabre\DAV\Server; use Sabre\DAVACL; use Sabre\HTTP; -abstract class AbstractPluginTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPluginTestCase extends TestCase { /** - * @var Sabre\CardDAV\Plugin + * @var Plugin */ protected $plugin; /** - * @var Sabre\DAV\Server + * @var Server */ protected $server; /** - * @var Sabre\CardDAV\Backend\Mock; + * @var Mock; */ protected $backend; @@ -35,7 +37,7 @@ public function setup(): void $this->plugin = new Plugin(); $this->plugin->directories = ['directory']; - $this->server = new DAV\Server($tree); + $this->server = new Server($tree); $this->server->sapi = new HTTP\SapiMock(); $this->server->addPlugin($this->plugin); $this->server->debugExceptions = true; diff --git a/tests/Sabre/CardDAV/AddressBookQueryTest.php b/tests/Sabre/CardDAV/AddressBookQueryTest.php index 7404b50dca..3e048ba46a 100644 --- a/tests/Sabre/CardDAV/AddressBookQueryTest.php +++ b/tests/Sabre/CardDAV/AddressBookQueryTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class AddressBookQueryTest extends AbstractPluginTest +class AddressBookQueryTest extends AbstractPluginTestCase { public function testQuery() { diff --git a/tests/Sabre/CardDAV/Backend/AbstractPDOTest.php b/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php similarity index 98% rename from tests/Sabre/CardDAV/Backend/AbstractPDOTest.php rename to tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php index ad1d4ddeae..aa77b4b1f4 100644 --- a/tests/Sabre/CardDAV/Backend/AbstractPDOTest.php +++ b/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php @@ -4,12 +4,14 @@ namespace Sabre\CardDAV\Backend; +use PHPUnit\Framework\TestCase; use Sabre\CardDAV; +use Sabre\DAV\DbTestHelperTrait; use Sabre\DAV\PropPatch; -abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPDOTestCase extends TestCase { - use \Sabre\DAV\DbTestHelperTrait; + use DbTestHelperTrait; /** * @var CardDAV\Backend\PDO diff --git a/tests/Sabre/CardDAV/Backend/PDOMySQLTest.php b/tests/Sabre/CardDAV/Backend/PDOMySQLTest.php index 718eec6be7..4b7f9ea9ea 100644 --- a/tests/Sabre/CardDAV/Backend/PDOMySQLTest.php +++ b/tests/Sabre/CardDAV/Backend/PDOMySQLTest.php @@ -4,7 +4,7 @@ namespace Sabre\CardDAV\Backend; -class PDOMySQLTest extends AbstractPDOTest +class PDOMySQLTest extends AbstractPDOTestCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/CardDAV/Backend/PDOPgSqlTest.php b/tests/Sabre/CardDAV/Backend/PDOPgSqlTest.php index 5db6da0a9c..4d58484401 100644 --- a/tests/Sabre/CardDAV/Backend/PDOPgSqlTest.php +++ b/tests/Sabre/CardDAV/Backend/PDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\CardDAV\Backend; -class PDOPgSqlTest extends AbstractPDOTest +class PDOPgSqlTest extends AbstractPDOTestCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/CardDAV/Backend/PDOSqliteTest.php b/tests/Sabre/CardDAV/Backend/PDOSqliteTest.php index b16a00ce28..0aef9a8a4c 100644 --- a/tests/Sabre/CardDAV/Backend/PDOSqliteTest.php +++ b/tests/Sabre/CardDAV/Backend/PDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\CardDAV\Backend; -class PDOSqliteTest extends AbstractPDOTest +class PDOSqliteTest extends AbstractPDOTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/CardDAV/MultiGetTest.php b/tests/Sabre/CardDAV/MultiGetTest.php index e2ee12b657..3557ddaeaa 100644 --- a/tests/Sabre/CardDAV/MultiGetTest.php +++ b/tests/Sabre/CardDAV/MultiGetTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class MultiGetTest extends AbstractPluginTest +class MultiGetTest extends AbstractPluginTestCase { public function testMultiGet() { diff --git a/tests/Sabre/CardDAV/PluginTest.php b/tests/Sabre/CardDAV/PluginTest.php index c3a41daf96..6d7d01fcaf 100644 --- a/tests/Sabre/CardDAV/PluginTest.php +++ b/tests/Sabre/CardDAV/PluginTest.php @@ -6,13 +6,13 @@ use Sabre\DAV; -class PluginTest extends AbstractPluginTest +class PluginTest extends AbstractPluginTestCase { public function testConstruct() { self::assertEquals('{'.Plugin::NS_CARDDAV.'}addressbook', $this->server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook']); - self::assertTrue(in_array('addressbook', $this->plugin->getFeatures())); + self::assertContains('addressbook', $this->plugin->getFeatures()); self::assertEquals('carddav', $this->plugin->getPluginInfo()['name']); } @@ -34,7 +34,7 @@ public function testAddressBookHomeSet() { $result = $this->server->getProperties('principals/user1', ['{'.Plugin::NS_CARDDAV.'}addressbook-home-set']); - self::assertEquals(1, count($result)); + self::assertCount(1, $result); self::assertTrue(isset($result['{'.Plugin::NS_CARDDAV.'}addressbook-home-set'])); self::assertEquals('addressbooks/user1/', $result['{'.Plugin::NS_CARDDAV.'}addressbook-home-set']->getHref()); } @@ -43,7 +43,7 @@ public function testDirectoryGateway() { $result = $this->server->getProperties('principals/user1', ['{'.Plugin::NS_CARDDAV.'}directory-gateway']); - self::assertEquals(1, count($result)); + self::assertCount(1, $result); self::assertTrue(isset($result['{'.Plugin::NS_CARDDAV.'}directory-gateway'])); self::assertEquals(['directory'], $result['{'.Plugin::NS_CARDDAV.'}directory-gateway']->getHrefs()); } diff --git a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php index 9410653628..1c761a5d2d 100644 --- a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php +++ b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php @@ -7,7 +7,7 @@ use Sabre\DAV\PropFind; use Sabre\HTTP; -class SogoStripContentTypeTest extends \Sabre\DAVServerTest +class SogoStripContentTypeTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCardDAV = true; protected $carddavAddressBooks = [ diff --git a/tests/Sabre/CardDAV/VCFExportTest.php b/tests/Sabre/CardDAV/VCFExportTest.php index 2e4eeacf66..65e3742225 100644 --- a/tests/Sabre/CardDAV/VCFExportTest.php +++ b/tests/Sabre/CardDAV/VCFExportTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class VCFExportTest extends \Sabre\DAVServerTest +class VCFExportTest extends \Sabre\AbstractDAVServerTestCase { protected $setupCardDAV = true; protected $autoLogin = 'user1'; diff --git a/tests/Sabre/CardDAV/ValidateFilterTest.php b/tests/Sabre/CardDAV/ValidateFilterTest.php index b56893bafe..b325d8459c 100644 --- a/tests/Sabre/CardDAV/ValidateFilterTest.php +++ b/tests/Sabre/CardDAV/ValidateFilterTest.php @@ -4,7 +4,7 @@ namespace Sabre\CardDAV; -class ValidateFilterTest extends AbstractPluginTest +class ValidateFilterTest extends AbstractPluginTestCase { /** * @param string $input diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php index e5dc36e9cb..ed8c99ad0b 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php @@ -7,7 +7,7 @@ use Sabre\CardDAV; use Sabre\DAV; -class SupportedAddressDataTest extends DAV\Xml\XmlTest +class SupportedAddressDataTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php index dd6e2d4843..e4f58139d5 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php @@ -7,7 +7,7 @@ use Sabre\CardDAV; use Sabre\DAV; -class SupportedCollationSetTest extends DAV\Xml\XmlTest +class SupportedCollationSetTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php index 29291578c0..d1d612329c 100644 --- a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php +++ b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php @@ -2,9 +2,9 @@ namespace Sabre\CardDAV\Xml\Request; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class AddressBookMultiGetReportTest extends XmlTest +class AddressBookMultiGetReportTest extends AbstractXmlTestCase { protected $elementMap = [ '{urn:ietf:params:xml:ns:carddav}addressbook-multiget' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookMultiGetReport', diff --git a/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php b/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php index b9fb036ecf..b2dbab4e93 100644 --- a/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php +++ b/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php @@ -4,9 +4,9 @@ namespace Sabre\CardDAV\Xml\Request; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class AddressBookQueryReportTest extends XmlTest +class AddressBookQueryReportTest extends AbstractXmlTestCase { protected $elementMap = [ '{urn:ietf:params:xml:ns:carddav}addressbook-query' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookQueryReport', diff --git a/tests/Sabre/DAV/AbstractServer.php b/tests/Sabre/DAV/AbstractServerTestCase.php similarity index 66% rename from tests/Sabre/DAV/AbstractServer.php rename to tests/Sabre/DAV/AbstractServerTestCase.php index ee321fd4c6..053a229dbc 100644 --- a/tests/Sabre/DAV/AbstractServer.php +++ b/tests/Sabre/DAV/AbstractServerTestCase.php @@ -4,42 +4,45 @@ namespace Sabre\DAV; +use PHPUnit\Framework\TestCase; use Sabre\HTTP; +use Sabre\HTTP\ResponseMock; +use Sabre\TestUtil; -abstract class AbstractServer extends \PHPUnit\Framework\TestCase +abstract class AbstractServerTestCase extends TestCase { /** - * @var \Sabre\HTTP\ResponseMock + * @var ResponseMock */ protected $response; protected $request; /** - * @var \Sabre\DAV\Server + * @var Server */ protected $server; - protected $tempDir = \Sabre\TestUtil::SABRE_TEMPDIR; + protected $tempDir = TestUtil::SABRE_TEMPDIR; public function setup(): void { - $this->response = new HTTP\ResponseMock(); + $this->response = new ResponseMock(); $this->server = new Server($this->getRootNode()); $this->server->sapi = new HTTP\SapiMock(); $this->server->httpResponse = $this->response; $this->server->debugExceptions = true; - $this->deleteTree(\Sabre\TestUtil::SABRE_TEMPDIR, false); - file_put_contents(\Sabre\TestUtil::SABRE_TEMPDIR.'/test.txt', 'Test contents'); - mkdir(\Sabre\TestUtil::SABRE_TEMPDIR.'/dir'); - file_put_contents(\Sabre\TestUtil::SABRE_TEMPDIR.'/dir/child.txt', 'Child contents'); + $this->deleteTree(TestUtil::SABRE_TEMPDIR, false); + file_put_contents(TestUtil::SABRE_TEMPDIR.'/test.txt', 'Test contents'); + mkdir(TestUtil::SABRE_TEMPDIR.'/dir'); + file_put_contents(TestUtil::SABRE_TEMPDIR.'/dir/child.txt', 'Child contents'); } public function teardown(): void { - $this->deleteTree(\Sabre\TestUtil::SABRE_TEMPDIR, false); + $this->deleteTree(TestUtil::SABRE_TEMPDIR, false); } protected function getRootNode() { - return new FS\Directory(\Sabre\TestUtil::SABRE_TEMPDIR); + return new FS\Directory(TestUtil::SABRE_TEMPDIR); } protected function getSanitizedBody() diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTestCase.php similarity index 96% rename from tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTest.php rename to tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTestCase.php index 3a5d9164d0..9ec8f06cab 100644 --- a/tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTest.php +++ b/tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTestCase.php @@ -4,11 +4,13 @@ namespace Sabre\DAV\Auth\Backend; +use PHPUnit\Framework\TestCase; +use Sabre\DAV\DbTestHelperTrait; use Sabre\HTTP; -abstract class AbstractPDOBasicAuthTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPDOBasicAuthTestCase extends TestCase { - use \Sabre\DAV\DbTestHelperTrait; + use DbTestHelperTrait; public function setup(): void { diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractPDOTestCaseCase.php similarity index 84% rename from tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php rename to tests/Sabre/DAV/Auth/Backend/AbstractPDOTestCaseCase.php index 66a04719d3..65deddcc38 100644 --- a/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php +++ b/tests/Sabre/DAV/Auth/Backend/AbstractPDOTestCaseCase.php @@ -4,9 +4,12 @@ namespace Sabre\DAV\Auth\Backend; -abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase +use PHPUnit\Framework\TestCase; +use Sabre\DAV\DbTestHelperTrait; + +abstract class AbstractPDOTestCaseCase extends TestCase { - use \Sabre\DAV\DbTestHelperTrait; + use DbTestHelperTrait; public function setup(): void { diff --git a/tests/Sabre/DAV/Auth/Backend/PDOBasicAuthSqliteTest.php b/tests/Sabre/DAV/Auth/Backend/PDOBasicAuthSqliteTest.php index e961bf0abb..c524ba4aec 100644 --- a/tests/Sabre/DAV/Auth/Backend/PDOBasicAuthSqliteTest.php +++ b/tests/Sabre/DAV/Auth/Backend/PDOBasicAuthSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Auth\Backend; -class PDOBasicAuthSqliteTest extends AbstractPDOBasicAuthTest +class PDOBasicAuthSqliteTest extends AbstractPDOBasicAuthTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/DAV/Auth/Backend/PDOMySQLTest.php b/tests/Sabre/DAV/Auth/Backend/PDOMySQLTest.php index 6ad7906c4f..888c677d48 100644 --- a/tests/Sabre/DAV/Auth/Backend/PDOMySQLTest.php +++ b/tests/Sabre/DAV/Auth/Backend/PDOMySQLTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Auth\Backend; -class PDOMySQLTest extends AbstractPDOTest +class PDOMySQLTest extends AbstractPDOTestCaseCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/DAV/Auth/Backend/PDOPgSqlTest.php b/tests/Sabre/DAV/Auth/Backend/PDOPgSqlTest.php index b82b07698c..48b9c84aa2 100644 --- a/tests/Sabre/DAV/Auth/Backend/PDOPgSqlTest.php +++ b/tests/Sabre/DAV/Auth/Backend/PDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Auth\Backend; -class PDOPgSqlTest extends AbstractPDOTest +class PDOPgSqlTest extends AbstractPDOTestCaseCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/DAV/Auth/Backend/PDOSqliteTest.php b/tests/Sabre/DAV/Auth/Backend/PDOSqliteTest.php index b42b40eff0..9012a3fa96 100644 --- a/tests/Sabre/DAV/Auth/Backend/PDOSqliteTest.php +++ b/tests/Sabre/DAV/Auth/Backend/PDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Auth\Backend; -class PDOSqliteTest extends AbstractPDOTest +class PDOSqliteTest extends AbstractPDOTestCaseCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/DAV/Browser/GuessContentTypeTest.php b/tests/Sabre/DAV/Browser/GuessContentTypeTest.php index 3da77f8b33..a918171cf3 100644 --- a/tests/Sabre/DAV/Browser/GuessContentTypeTest.php +++ b/tests/Sabre/DAV/Browser/GuessContentTypeTest.php @@ -6,7 +6,7 @@ use Sabre\DAV; -class GuessContentTypeTest extends DAV\AbstractServer +class GuessContentTypeTest extends DAV\AbstractServerTestCase { public function setUp(): void { diff --git a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php index b128289c4d..68193ce6d0 100644 --- a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php +++ b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class MapGetToPropFindTest extends DAV\AbstractServer +class MapGetToPropFindTest extends DAV\AbstractServerTestCase { public function setUp(): void { diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index 9e2cfd692e..6efb00b081 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class PluginTest extends DAV\AbstractServer +class PluginTest extends DAV\AbstractServerTestCase { protected $plugin; diff --git a/tests/Sabre/DAV/FSExt/ServerTest.php b/tests/Sabre/DAV/FSExt/ServerTest.php index d6aeaf82f9..3f2277400e 100644 --- a/tests/Sabre/DAV/FSExt/ServerTest.php +++ b/tests/Sabre/DAV/FSExt/ServerTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class ServerTest extends DAV\AbstractServer +class ServerTest extends DAV\AbstractServerTestCase { protected function getRootNode() { diff --git a/tests/Sabre/DAV/GetIfConditionsTest.php b/tests/Sabre/DAV/GetIfConditionsTest.php index 9f613398fc..afee554377 100644 --- a/tests/Sabre/DAV/GetIfConditionsTest.php +++ b/tests/Sabre/DAV/GetIfConditionsTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class GetIfConditionsTest extends AbstractServer +class GetIfConditionsTest extends AbstractServerTestCase { public function testNoConditions() { diff --git a/tests/Sabre/DAV/HTTPPreferParsingTest.php b/tests/Sabre/DAV/HTTPPreferParsingTest.php index d91882eae6..5ab171b6ba 100644 --- a/tests/Sabre/DAV/HTTPPreferParsingTest.php +++ b/tests/Sabre/DAV/HTTPPreferParsingTest.php @@ -4,11 +4,12 @@ namespace Sabre\DAV; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; -class HTTPPreferParsingTest extends \Sabre\DAVServerTest +class HTTPPreferParsingTest extends AbstractDAVServerTestCase { - public function assertParseResult($input, $expected) + public static function assertParseResult($input, $expected) { $httpRequest = new HTTP\Request('GET', '/foo', [ 'Prefer' => $input, diff --git a/tests/Sabre/DAV/HttpCopyTest.php b/tests/Sabre/DAV/HttpCopyTest.php index 96a516a3b8..1089713000 100644 --- a/tests/Sabre/DAV/HttpCopyTest.php +++ b/tests/Sabre/DAV/HttpCopyTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpCopyTest extends DAVServerTest +class HttpCopyTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/HttpDeleteTest.php b/tests/Sabre/DAV/HttpDeleteTest.php index 2fc29ee0f6..c286971463 100644 --- a/tests/Sabre/DAV/HttpDeleteTest.php +++ b/tests/Sabre/DAV/HttpDeleteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpDeleteTest extends DAVServerTest +class HttpDeleteTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/HttpGetTest.php b/tests/Sabre/DAV/HttpGetTest.php index 61e8f58251..69fadaa8f0 100644 --- a/tests/Sabre/DAV/HttpGetTest.php +++ b/tests/Sabre/DAV/HttpGetTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpGetTest extends DAVServerTest +class HttpGetTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/HttpHeadTest.php b/tests/Sabre/DAV/HttpHeadTest.php index e719ef3cf6..68d88f7619 100644 --- a/tests/Sabre/DAV/HttpHeadTest.php +++ b/tests/Sabre/DAV/HttpHeadTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpHeadTest extends DAVServerTest +class HttpHeadTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/HttpMoveTest.php b/tests/Sabre/DAV/HttpMoveTest.php index cd3cce58fc..e9ccfa0917 100644 --- a/tests/Sabre/DAV/HttpMoveTest.php +++ b/tests/Sabre/DAV/HttpMoveTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpMoveTest extends DAVServerTest +class HttpMoveTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/HttpPutTest.php b/tests/Sabre/DAV/HttpPutTest.php index cdc567c944..ace66e395c 100644 --- a/tests/Sabre/DAV/HttpPutTest.php +++ b/tests/Sabre/DAV/HttpPutTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -use Sabre\DAVServerTest; +use Sabre\AbstractDAVServerTestCase; use Sabre\HTTP; /** @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class HttpPutTest extends DAVServerTest +class HttpPutTest extends AbstractDAVServerTestCase { /** * Sets up the DAV tree. diff --git a/tests/Sabre/DAV/Locks/Backend/PDOMySQLTest.php b/tests/Sabre/DAV/Locks/Backend/AbstractPDOMySQLTest.php similarity index 65% rename from tests/Sabre/DAV/Locks/Backend/PDOMySQLTest.php rename to tests/Sabre/DAV/Locks/Backend/AbstractPDOMySQLTest.php index 86ffc0bb32..e9d611dd8a 100644 --- a/tests/Sabre/DAV/Locks/Backend/PDOMySQLTest.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractPDOMySQLTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Locks\Backend; -class PDOMySQLTest extends PDOTest +class AbstractPDOMySQLTest extends AbstractPDOTestCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/DAV/Locks/Backend/PDOPgSqlTest.php b/tests/Sabre/DAV/Locks/Backend/AbstractPDOPgSqlTest.php similarity index 65% rename from tests/Sabre/DAV/Locks/Backend/PDOPgSqlTest.php rename to tests/Sabre/DAV/Locks/Backend/AbstractPDOPgSqlTest.php index 4ab0579444..0a6bc6353a 100644 --- a/tests/Sabre/DAV/Locks/Backend/PDOPgSqlTest.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractPDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Locks\Backend; -class PDOPgSqlTest extends PDOTest +class AbstractPDOPgSqlTest extends AbstractPDOTestCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/DAV/Locks/Backend/PDOSqliteTest.php b/tests/Sabre/DAV/Locks/Backend/AbstractPDOSqliteTest.php similarity index 65% rename from tests/Sabre/DAV/Locks/Backend/PDOSqliteTest.php rename to tests/Sabre/DAV/Locks/Backend/AbstractPDOSqliteTest.php index f0c384d4c2..fb82a702ce 100644 --- a/tests/Sabre/DAV/Locks/Backend/PDOSqliteTest.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractPDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Locks\Backend; -class PDOSqliteTest extends PDOTest +class AbstractPDOSqliteTest extends AbstractPDOTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/DAV/Locks/Backend/PDOTest.php b/tests/Sabre/DAV/Locks/Backend/AbstractPDOTestCase.php similarity index 83% rename from tests/Sabre/DAV/Locks/Backend/PDOTest.php rename to tests/Sabre/DAV/Locks/Backend/AbstractPDOTestCase.php index f5ed98f507..b2b23ccd6b 100644 --- a/tests/Sabre/DAV/Locks/Backend/PDOTest.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractPDOTestCase.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Locks\Backend; -abstract class PDOTest extends AbstractTest +abstract class AbstractPDOTestCase extends AbstractTestCase { use \Sabre\DAV\DbTestHelperTrait; diff --git a/tests/Sabre/DAV/Locks/Backend/AbstractTest.php b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php similarity index 98% rename from tests/Sabre/DAV/Locks/Backend/AbstractTest.php rename to tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php index 1a7c5fa94a..73425e6b8f 100644 --- a/tests/Sabre/DAV/Locks/Backend/AbstractTest.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php @@ -4,9 +4,10 @@ namespace Sabre\DAV\Locks\Backend; +use PHPUnit\Framework\TestCase; use Sabre\DAV; -abstract class AbstractTest extends \PHPUnit\Framework\TestCase +abstract class AbstractTestCase extends TestCase { /** * @abstract diff --git a/tests/Sabre/DAV/Locks/Backend/FileTest.php b/tests/Sabre/DAV/Locks/Backend/FileTest.php index f96c09e282..90c5b4d4d7 100644 --- a/tests/Sabre/DAV/Locks/Backend/FileTest.php +++ b/tests/Sabre/DAV/Locks/Backend/FileTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\Locks\Backend; -class FileTest extends AbstractTest +class FileTest extends AbstractTestCase { public function getBackend() { diff --git a/tests/Sabre/DAV/Locks/Plugin2Test.php b/tests/Sabre/DAV/Locks/Plugin2Test.php index 9548363e9d..ec8b2385c8 100644 --- a/tests/Sabre/DAV/Locks/Plugin2Test.php +++ b/tests/Sabre/DAV/Locks/Plugin2Test.php @@ -6,7 +6,7 @@ use Sabre\HTTP\Request; -class Plugin2Test extends \Sabre\DAVServerTest +class Plugin2Test extends \Sabre\AbstractDAVServerTestCase { public $setupLocks = true; diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php index 70530d2f53..66f16abd81 100644 --- a/tests/Sabre/DAV/Locks/PluginTest.php +++ b/tests/Sabre/DAV/Locks/PluginTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class PluginTest extends DAV\AbstractServer +class PluginTest extends DAV\AbstractServerTestCase { /** * @var Plugin diff --git a/tests/Sabre/DAV/Mount/PluginTest.php b/tests/Sabre/DAV/Mount/PluginTest.php index 12f75cb363..e630d561f8 100644 --- a/tests/Sabre/DAV/Mount/PluginTest.php +++ b/tests/Sabre/DAV/Mount/PluginTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class PluginTest extends DAV\AbstractServer +class PluginTest extends DAV\AbstractServerTestCase { public function setup(): void { diff --git a/tests/Sabre/DAV/PartialUpdate/PluginTest.php b/tests/Sabre/DAV/PartialUpdate/PluginTest.php index deb18b5a4a..035813578b 100644 --- a/tests/Sabre/DAV/PartialUpdate/PluginTest.php +++ b/tests/Sabre/DAV/PartialUpdate/PluginTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class PluginTest extends \Sabre\DAVServerTest +class PluginTest extends \Sabre\AbstractDAVServerTestCase { protected $node; protected $plugin; diff --git a/tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTest.php b/tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTestCase.php similarity index 97% rename from tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTest.php rename to tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTestCase.php index 79dcdb6dd9..0c8571080f 100644 --- a/tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTest.php +++ b/tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTestCase.php @@ -4,14 +4,16 @@ namespace Sabre\DAV\PropertyStorage\Backend; +use PHPUnit\Framework\TestCase; +use Sabre\DAV\DbTestHelperTrait; use Sabre\DAV\PropFind; use Sabre\DAV\PropPatch; use Sabre\DAV\Xml\Property\Complex; use Sabre\DAV\Xml\Property\Href; -abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPDOTestCase extends TestCase { - use \Sabre\DAV\DbTestHelperTrait; + use DbTestHelperTrait; public function getBackend() { diff --git a/tests/Sabre/DAV/PropertyStorage/Backend/PDOMysqlTest.php b/tests/Sabre/DAV/PropertyStorage/Backend/PDOMysqlTest.php index 6e11317c20..92d60837ac 100644 --- a/tests/Sabre/DAV/PropertyStorage/Backend/PDOMysqlTest.php +++ b/tests/Sabre/DAV/PropertyStorage/Backend/PDOMysqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\PropertyStorage\Backend; -class PDOMysqlTest extends AbstractPDOTest +class PDOMysqlTest extends AbstractPDOTestCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/DAV/PropertyStorage/Backend/PDOPgSqlTest.php b/tests/Sabre/DAV/PropertyStorage/Backend/PDOPgSqlTest.php index 23955f35d8..cd8883a07e 100644 --- a/tests/Sabre/DAV/PropertyStorage/Backend/PDOPgSqlTest.php +++ b/tests/Sabre/DAV/PropertyStorage/Backend/PDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\PropertyStorage\Backend; -class PDOPgSqlTest extends AbstractPDOTest +class PDOPgSqlTest extends AbstractPDOTestCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/DAV/PropertyStorage/Backend/PDOSqliteTest.php b/tests/Sabre/DAV/PropertyStorage/Backend/PDOSqliteTest.php index 37b0ed205d..89228e0d54 100644 --- a/tests/Sabre/DAV/PropertyStorage/Backend/PDOSqliteTest.php +++ b/tests/Sabre/DAV/PropertyStorage/Backend/PDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\PropertyStorage\Backend; -class PDOSqliteTest extends AbstractPDOTest +class PDOSqliteTest extends AbstractPDOTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/DAV/PropertyStorage/PluginTest.php b/tests/Sabre/DAV/PropertyStorage/PluginTest.php index 7a5d417f48..fd083d467a 100644 --- a/tests/Sabre/DAV/PropertyStorage/PluginTest.php +++ b/tests/Sabre/DAV/PropertyStorage/PluginTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV\PropertyStorage; -class PluginTest extends \Sabre\DAVServerTest +class PluginTest extends \Sabre\AbstractDAVServerTestCase { protected $backend; protected $plugin; diff --git a/tests/Sabre/DAV/ServerEventsTest.php b/tests/Sabre/DAV/ServerEventsTest.php index e4db38ce44..b7de1c3826 100644 --- a/tests/Sabre/DAV/ServerEventsTest.php +++ b/tests/Sabre/DAV/ServerEventsTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class ServerEventsTest extends AbstractServer +class ServerEventsTest extends AbstractServerTestCase { private $tempPath; diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php index 56653dc7db..9e9dfb88bc 100644 --- a/tests/Sabre/DAV/ServerMKCOLTest.php +++ b/tests/Sabre/DAV/ServerMKCOLTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class ServerMKCOLTest extends AbstractServer +class ServerMKCOLTest extends AbstractServerTestCase { public function testMkcol() { diff --git a/tests/Sabre/DAV/ServerPluginTest.php b/tests/Sabre/DAV/ServerPluginTest.php index fc613beef5..19d99b9953 100644 --- a/tests/Sabre/DAV/ServerPluginTest.php +++ b/tests/Sabre/DAV/ServerPluginTest.php @@ -6,10 +6,10 @@ use Sabre\HTTP; -class ServerPluginTest extends AbstractServer +class ServerPluginTest extends AbstractServerTestCase { /** - * @var Sabre\DAV\TestPlugin + * @var TestPlugin */ protected $testPlugin; diff --git a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php index db28680816..c60e3899ba 100644 --- a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php +++ b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class ServerPropsInfiniteDepthTest extends AbstractServer +class ServerPropsInfiniteDepthTest extends AbstractServerTestCase { protected function getRootNode() { diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php index 6f4626f0fd..398f04f53c 100644 --- a/tests/Sabre/DAV/ServerPropsTest.php +++ b/tests/Sabre/DAV/ServerPropsTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class ServerPropsTest extends AbstractServer +class ServerPropsTest extends AbstractServerTestCase { protected function getRootNode() { diff --git a/tests/Sabre/DAV/ServerRangeTest.php b/tests/Sabre/DAV/ServerRangeTest.php index d06a4ad6a4..17ca773844 100644 --- a/tests/Sabre/DAV/ServerRangeTest.php +++ b/tests/Sabre/DAV/ServerRangeTest.php @@ -14,7 +14,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ServerRangeTest extends \Sabre\DAVServerTest +class ServerRangeTest extends \Sabre\AbstractDAVServerTestCase { protected $setupFiles = true; diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php index c8222227f8..9f741879d9 100644 --- a/tests/Sabre/DAV/ServerSimpleTest.php +++ b/tests/Sabre/DAV/ServerSimpleTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class ServerSimpleTest extends AbstractServer +class ServerSimpleTest extends AbstractServerTestCase { public function testConstructArray() { diff --git a/tests/Sabre/DAV/Sharing/PluginTest.php b/tests/Sabre/DAV/Sharing/PluginTest.php index 71767050e8..2da35529c9 100644 --- a/tests/Sabre/DAV/Sharing/PluginTest.php +++ b/tests/Sabre/DAV/Sharing/PluginTest.php @@ -7,7 +7,7 @@ use Sabre\DAV\Mock; use Sabre\DAV\Xml\Property; -class PluginTest extends \Sabre\DAVServerTest +class PluginTest extends \Sabre\AbstractDAVServerTestCase { protected $setupSharing = true; protected $setupACL = true; diff --git a/tests/Sabre/DAV/Sharing/ShareResourceTest.php b/tests/Sabre/DAV/Sharing/ShareResourceTest.php index 2f39febbe2..aa1092e906 100644 --- a/tests/Sabre/DAV/Sharing/ShareResourceTest.php +++ b/tests/Sabre/DAV/Sharing/ShareResourceTest.php @@ -8,7 +8,7 @@ use Sabre\DAV\Xml\Element\Sharee; use Sabre\HTTP\Request; -class ShareResourceTest extends \Sabre\DAVServerTest +class ShareResourceTest extends \Sabre\AbstractDAVServerTestCase { protected $setupSharing = true; protected $sharingNodeMock; diff --git a/tests/Sabre/DAV/Sync/PluginTest.php b/tests/Sabre/DAV/Sync/PluginTest.php index b5bc96e3eb..bfe0d157a6 100644 --- a/tests/Sabre/DAV/Sync/PluginTest.php +++ b/tests/Sabre/DAV/Sync/PluginTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class PluginTest extends \Sabre\DAVServerTest +class PluginTest extends \Sabre\AbstractDAVServerTestCase { protected $collection; diff --git a/tests/Sabre/DAV/SyncTokenPropertyTest.php b/tests/Sabre/DAV/SyncTokenPropertyTest.php index ece6f59b82..6603dbbf1d 100644 --- a/tests/Sabre/DAV/SyncTokenPropertyTest.php +++ b/tests/Sabre/DAV/SyncTokenPropertyTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAV; -class SyncTokenPropertyTest extends \Sabre\DAVServerTest +class SyncTokenPropertyTest extends \Sabre\AbstractDAVServerTestCase { /** * The assumption in these tests is that a PROPFIND is going on, and to diff --git a/tests/Sabre/DAV/TemporaryFileFilterTest.php b/tests/Sabre/DAV/TemporaryFileFilterTest.php index 95469141e5..5082a0f73f 100644 --- a/tests/Sabre/DAV/TemporaryFileFilterTest.php +++ b/tests/Sabre/DAV/TemporaryFileFilterTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP; -class TemporaryFileFilterTest extends AbstractServer +class TemporaryFileFilterTest extends AbstractServerTestCase { public function setup(): void { diff --git a/tests/Sabre/DAV/Xml/XmlTest.php b/tests/Sabre/DAV/Xml/AbstractXmlTestCase.php similarity index 92% rename from tests/Sabre/DAV/Xml/XmlTest.php rename to tests/Sabre/DAV/Xml/AbstractXmlTestCase.php index c556767adf..d44fff59a5 100644 --- a/tests/Sabre/DAV/Xml/XmlTest.php +++ b/tests/Sabre/DAV/Xml/AbstractXmlTestCase.php @@ -4,10 +4,11 @@ namespace Sabre\DAV\Xml; +use PHPUnit\Framework\TestCase; use Sabre\Xml\Reader; use Sabre\Xml\Writer; -abstract class XmlTest extends \PHPUnit\Framework\TestCase +abstract class AbstractXmlTestCase extends TestCase { protected $elementMap = []; protected $namespaceMap = ['DAV:' => 'd']; diff --git a/tests/Sabre/DAV/Xml/Element/PropTest.php b/tests/Sabre/DAV/Xml/Element/PropTest.php index 91bd2a92cb..939addedae 100644 --- a/tests/Sabre/DAV/Xml/Element/PropTest.php +++ b/tests/Sabre/DAV/Xml/Element/PropTest.php @@ -4,11 +4,11 @@ namespace Sabre\DAV\Xml\Element; +use Sabre\DAV\Xml\AbstractXmlTestCase; use Sabre\DAV\Xml\Property\Complex; use Sabre\DAV\Xml\Property\Href; -use Sabre\DAV\Xml\XmlTest; -class PropTest extends XmlTest +class PropTest extends AbstractXmlTestCase { public function testDeserializeSimple() { diff --git a/tests/Sabre/DAV/Xml/Element/ResponseTest.php b/tests/Sabre/DAV/Xml/Element/ResponseTest.php index 0950acce61..9863475ccd 100644 --- a/tests/Sabre/DAV/Xml/Element/ResponseTest.php +++ b/tests/Sabre/DAV/Xml/Element/ResponseTest.php @@ -6,7 +6,7 @@ use Sabre\DAV; -class ResponseTest extends DAV\Xml\XmlTest +class ResponseTest extends DAV\Xml\AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/DAV/Xml/Element/ShareeTest.php b/tests/Sabre/DAV/Xml/Element/ShareeTest.php index 22c21d5897..ff1ba307ef 100644 --- a/tests/Sabre/DAV/Xml/Element/ShareeTest.php +++ b/tests/Sabre/DAV/Xml/Element/ShareeTest.php @@ -5,9 +5,9 @@ namespace Sabre\DAV\Xml\Element; use Sabre\DAV\Sharing\Plugin; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class ShareeTest extends XmlTest +class ShareeTest extends AbstractXmlTestCase { public function testShareeUnknownPropertyInConstructor() { diff --git a/tests/Sabre/DAV/Xml/Property/HrefTest.php b/tests/Sabre/DAV/Xml/Property/HrefTest.php index b2c9ac8b75..dcc564b26b 100644 --- a/tests/Sabre/DAV/Xml/Property/HrefTest.php +++ b/tests/Sabre/DAV/Xml/Property/HrefTest.php @@ -5,9 +5,9 @@ namespace Sabre\DAV\Xml\Property; use Sabre\DAV\Browser\HtmlOutputHelper; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class HrefTest extends XmlTest +class HrefTest extends AbstractXmlTestCase { public function testConstruct() { diff --git a/tests/Sabre/DAV/Xml/Property/InviteTest.php b/tests/Sabre/DAV/Xml/Property/InviteTest.php index 0a18649bcb..9f43f7e6f2 100644 --- a/tests/Sabre/DAV/Xml/Property/InviteTest.php +++ b/tests/Sabre/DAV/Xml/Property/InviteTest.php @@ -5,10 +5,10 @@ namespace Sabre\DAV\Xml\Property; use Sabre\DAV\Sharing\Plugin; +use Sabre\DAV\Xml\AbstractXmlTestCase; use Sabre\DAV\Xml\Element\Sharee; -use Sabre\DAV\Xml\XmlTest; -class InviteTest extends XmlTest +class InviteTest extends AbstractXmlTestCase { public function testSerialize() { diff --git a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php index 4fda0771a3..ffce1366ce 100644 --- a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php +++ b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php @@ -6,9 +6,9 @@ use DateTime; use DateTimeZone; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class LastModifiedTest extends XmlTest +class LastModifiedTest extends AbstractXmlTestCase { public function testSerializeDateTime() { diff --git a/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php b/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php index 42a4017b83..a03da08e0d 100644 --- a/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php +++ b/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php @@ -5,9 +5,9 @@ namespace Sabre\DAV\Xml\Property; use Sabre\DAV\Browser\HtmlOutputHelper; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class LocalHrefTest extends XmlTest +class LocalHrefTest extends AbstractXmlTestCase { public function testConstruct() { diff --git a/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php b/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php index 1cc279e153..a68877206b 100644 --- a/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php +++ b/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php @@ -5,9 +5,9 @@ namespace Sabre\DAV\Xml\Property; use Sabre\DAV\Locks\LockInfo; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class LockDiscoveryTest extends XmlTest +class LockDiscoveryTest extends AbstractXmlTestCase { public function testSerialize() { diff --git a/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php b/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php index 716f5ecbd0..1959bb12b5 100644 --- a/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php +++ b/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php @@ -5,9 +5,9 @@ namespace Sabre\DAV\Xml\Property; use Sabre\DAV\Sharing\Plugin; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class ShareAccessTest extends XmlTest +class ShareAccessTest extends AbstractXmlTestCase { public function testSerialize() { diff --git a/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php b/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php index 2efedd2e8c..3df5d3fbbf 100644 --- a/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php +++ b/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php @@ -4,9 +4,9 @@ namespace Sabre\DAV\Xml\Property; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class SupportedMethodSetTest extends XmlTest +class SupportedMethodSetTest extends AbstractXmlTestCase { public function testSimple() { diff --git a/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php b/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php index 6fd03e95f6..113ab4e7d8 100644 --- a/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php +++ b/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php @@ -7,7 +7,7 @@ use Sabre\DAV; use Sabre\HTTP; -class SupportedReportSetTest extends DAV\AbstractServer +class SupportedReportSetTest extends DAV\AbstractServerTestCase { public function sendPROPFIND($body) { diff --git a/tests/Sabre/DAV/Xml/Request/PropFindTest.php b/tests/Sabre/DAV/Xml/Request/PropFindTest.php index 48e212f554..bad1d0b198 100644 --- a/tests/Sabre/DAV/Xml/Request/PropFindTest.php +++ b/tests/Sabre/DAV/Xml/Request/PropFindTest.php @@ -4,9 +4,9 @@ namespace Sabre\DAV\Xml\Request; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class PropFindTest extends XmlTest +class PropFindTest extends AbstractXmlTestCase { public function testDeserializeProp() { diff --git a/tests/Sabre/DAV/Xml/Request/PropPatchTest.php b/tests/Sabre/DAV/Xml/Request/PropPatchTest.php index 674b76bd24..e6ffb801d5 100644 --- a/tests/Sabre/DAV/Xml/Request/PropPatchTest.php +++ b/tests/Sabre/DAV/Xml/Request/PropPatchTest.php @@ -4,10 +4,10 @@ namespace Sabre\DAV\Xml\Request; +use Sabre\DAV\Xml\AbstractXmlTestCase; use Sabre\DAV\Xml\Property\Href; -use Sabre\DAV\Xml\XmlTest; -class PropPatchTest extends XmlTest +class PropPatchTest extends AbstractXmlTestCase { public function testSerialize() { diff --git a/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php b/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php index f089048cab..aac66c9aac 100644 --- a/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php +++ b/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php @@ -5,10 +5,10 @@ namespace Sabre\DAV\Xml\Request; use Sabre\DAV\Sharing\Plugin; +use Sabre\DAV\Xml\AbstractXmlTestCase; use Sabre\DAV\Xml\Element\Sharee; -use Sabre\DAV\Xml\XmlTest; -class ShareResourceTest extends XmlTest +class ShareResourceTest extends AbstractXmlTestCase { public function testDeserialize() { diff --git a/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php b/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php index 7cc2d3806e..8cb811c4f2 100644 --- a/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php +++ b/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php @@ -4,9 +4,9 @@ namespace Sabre\DAV\Xml\Request; -use Sabre\DAV\Xml\XmlTest; +use Sabre\DAV\Xml\AbstractXmlTestCase; -class SyncCollectionTest extends XmlTest +class SyncCollectionTest extends AbstractXmlTestCase { public function testDeserializeProp() { diff --git a/tests/Sabre/DAVACL/AclPrincipalPropSetReportTest.php b/tests/Sabre/DAVACL/AclPrincipalPropSetReportTest.php index 03b621dc9e..a5184cf600 100644 --- a/tests/Sabre/DAVACL/AclPrincipalPropSetReportTest.php +++ b/tests/Sabre/DAVACL/AclPrincipalPropSetReportTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP\Request; -class AclPrincipalPropSetReportTest extends \Sabre\DAVServerTest +class AclPrincipalPropSetReportTest extends \Sabre\AbstractDAVServerTestCase { public $setupACL = true; public $autoLogin = 'admin'; diff --git a/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php b/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTestCase.php similarity index 88% rename from tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php rename to tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTestCase.php index 476a608c40..ac5af45aab 100644 --- a/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php +++ b/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTestCase.php @@ -4,9 +4,10 @@ namespace Sabre\DAVACL\PrincipalBackend; +use PHPUnit\Framework\TestCase; use Sabre\DAV; -abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase +abstract class AbstractPDOTestCase extends TestCase { use DAV\DbTestHelperTrait; @@ -23,17 +24,17 @@ public function setup(): void $pdo->query('INSERT INTO groupmembers (principal_id,member_id) VALUES (5,4)'); } - public function testConstruct() + public function testConstruct(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); - self::assertTrue($backend instanceof PDO); + self::assertInstanceOf(PDO::class, $backend); } /** * @depends testConstruct */ - public function testGetPrincipalsByPrefix() + public function testGetPrincipalsByPrefix(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -63,7 +64,7 @@ public function testGetPrincipalsByPrefix() /** * @depends testConstruct */ - public function testGetPrincipalByPath() + public function testGetPrincipalByPath(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -79,7 +80,7 @@ public function testGetPrincipalByPath() self::assertEquals(null, $backend->getPrincipalByPath('foo')); } - public function testGetGroupMemberSet() + public function testGetGroupMemberSet(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -88,7 +89,7 @@ public function testGetGroupMemberSet() self::assertEquals($expected, $backend->getGroupMemberSet('principals/group')); } - public function testGetGroupMembership() + public function testGetGroupMembership(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -97,7 +98,7 @@ public function testGetGroupMembership() self::assertEquals($expected, $backend->getGroupMembership('principals/user')); } - public function testSetGroupMemberSet() + public function testSetGroupMemberSet(): void { $pdo = $this->getPDO(); @@ -114,7 +115,7 @@ public function testSetGroupMemberSet() self::assertEquals(['principals/user'], $backend->getGroupMemberSet('principals/group')); } - public function testSearchPrincipals() + public function testSearchPrincipals(): void { $pdo = $this->getPDO(); @@ -133,7 +134,7 @@ public function testSearchPrincipals() self::assertEquals([], $result); } - public function testUpdatePrincipal() + public function testUpdatePrincipal(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -155,7 +156,7 @@ public function testUpdatePrincipal() ], $backend->getPrincipalByPath('principals/user')); } - public function testUpdatePrincipalUnknownField() + public function testUpdatePrincipalUnknownField(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -183,14 +184,14 @@ public function testUpdatePrincipalUnknownField() ], $backend->getPrincipalByPath('principals/user')); } - public function testFindByUriUnknownScheme() + public function testFindByUriUnknownScheme(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); self::assertNull($backend->findByUri('http://foo', 'principals')); } - public function testFindByUriWithMailtoAddress() + public function testFindByUriWithMailtoAddress(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -200,7 +201,7 @@ public function testFindByUriWithMailtoAddress() ); } - public function testFindByUriWithUri() + public function testFindByUriWithUri(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); @@ -210,7 +211,7 @@ public function testFindByUriWithUri() ); } - public function testFindByUriWithUnknownUri() + public function testFindByUriWithUnknownUri(): void { $pdo = $this->getPDO(); $backend = new PDO($pdo); diff --git a/tests/Sabre/DAVACL/PrincipalBackend/PDOMySQLTest.php b/tests/Sabre/DAVACL/PrincipalBackend/PDOMySQLTest.php index 54795cf4d8..f726a14ea8 100644 --- a/tests/Sabre/DAVACL/PrincipalBackend/PDOMySQLTest.php +++ b/tests/Sabre/DAVACL/PrincipalBackend/PDOMySQLTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAVACL\PrincipalBackend; -class PDOMySQLTest extends AbstractPDOTest +class PDOMySQLTest extends AbstractPDOTestCase { public $driver = 'mysql'; } diff --git a/tests/Sabre/DAVACL/PrincipalBackend/PDOPgSqlTest.php b/tests/Sabre/DAVACL/PrincipalBackend/PDOPgSqlTest.php index 7abc816ff1..08e1d04012 100644 --- a/tests/Sabre/DAVACL/PrincipalBackend/PDOPgSqlTest.php +++ b/tests/Sabre/DAVACL/PrincipalBackend/PDOPgSqlTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAVACL\PrincipalBackend; -class PDOPgSqlTest extends AbstractPDOTest +class PDOPgSqlTest extends AbstractPDOTestCase { public $driver = 'pgsql'; } diff --git a/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php b/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php index 549e0bd60e..48842ef750 100644 --- a/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php +++ b/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAVACL\PrincipalBackend; -class PDOSqliteTest extends AbstractPDOTest +class PDOSqliteTest extends AbstractPDOTestCase { public $driver = 'sqlite'; } diff --git a/tests/Sabre/DAVACL/PrincipalMatchTest.php b/tests/Sabre/DAVACL/PrincipalMatchTest.php index b4515863d7..8321eeee1f 100644 --- a/tests/Sabre/DAVACL/PrincipalMatchTest.php +++ b/tests/Sabre/DAVACL/PrincipalMatchTest.php @@ -6,7 +6,7 @@ use Sabre\HTTP\Request; -class PrincipalMatchTest extends \Sabre\DAVServerTest +class PrincipalMatchTest extends \Sabre\AbstractDAVServerTestCase { public $setupACL = true; public $autoLogin = 'user1'; diff --git a/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php b/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php index de24d9aba6..4909792fcf 100644 --- a/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php +++ b/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php @@ -4,7 +4,7 @@ namespace Sabre\DAVACL\Xml\Request; -class AclPrincipalPropSetReportTest extends \Sabre\DAV\Xml\XmlTest +class AclPrincipalPropSetReportTest extends \Sabre\DAV\Xml\AbstractXmlTestCase { protected $elementMap = [ '{DAV:}acl-principal-prop-set' => 'Sabre\DAVACL\Xml\Request\AclPrincipalPropSetReport', diff --git a/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php b/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php index 209b21259c..bc890f8d41 100644 --- a/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php +++ b/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php @@ -4,7 +4,9 @@ namespace Sabre\DAVACL\Xml\Request; -class PrincipalMatchReportTest extends \Sabre\DAV\Xml\XmlTest +use Sabre\DAV\Xml\AbstractXmlTestCase; + +class PrincipalMatchReportTest extends AbstractXmlTestCase { protected $elementMap = [ '{DAV:}principal-match' => 'Sabre\DAVACL\Xml\Request\PrincipalMatchReport', diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 9186dfc307..8a3dc7dcbb 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -6,9 +6,6 @@ - - ../vendor/sabre/http/tests/HTTP - Sabre/DAV