diff --git a/lib/CalDAV/Notifications/Plugin.php b/lib/CalDAV/Notifications/Plugin.php index 56b2fe9384..e6949101f7 100644 --- a/lib/CalDAV/Notifications/Plugin.php +++ b/lib/CalDAV/Notifications/Plugin.php @@ -68,7 +68,7 @@ public function initialize(Server $server) $server->on('propFind', [$this, 'propFind']); $server->xml->namespaceMap[self::NS_CALENDARSERVER] = 'cs'; - $server->resourceTypeMapping['\\Sabre\\CalDAV\\Notifications\\ICollection'] = '{'.self::NS_CALENDARSERVER.'}notification'; + $server->resourceTypeMapping[\Sabre\CalDAV\Notifications\ICollection::class] = '{'.self::NS_CALENDARSERVER.'}notification'; array_push($server->protectedProperties, '{'.self::NS_CALENDARSERVER.'}notification-URL', diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php index ccb722f857..167025e67e 100644 --- a/lib/CalDAV/Plugin.php +++ b/lib/CalDAV/Plugin.php @@ -200,18 +200,18 @@ public function initialize(DAV\Server $server) $server->xml->namespaceMap[self::NS_CALDAV] = 'cal'; $server->xml->namespaceMap[self::NS_CALENDARSERVER] = 'cs'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}supported-calendar-component-set'] = 'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}calendar-query'] = 'Sabre\\CalDAV\\Xml\\Request\\CalendarQueryReport'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}calendar-multiget'] = 'Sabre\\CalDAV\\Xml\\Request\\CalendarMultiGetReport'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}free-busy-query'] = 'Sabre\\CalDAV\\Xml\\Request\\FreeBusyQueryReport'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}mkcalendar'] = 'Sabre\\CalDAV\\Xml\\Request\\MkCalendar'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}schedule-calendar-transp'] = 'Sabre\\CalDAV\\Xml\\Property\\ScheduleCalendarTransp'; - $server->xml->elementMap['{'.self::NS_CALDAV.'}supported-calendar-component-set'] = 'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'; - - $server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar'; - - $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read'; - $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write'; + $server->xml->elementMap['{'.self::NS_CALDAV.'}supported-calendar-component-set'] = \Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}calendar-query'] = \Sabre\CalDAV\Xml\Request\CalendarQueryReport::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}calendar-multiget'] = \Sabre\CalDAV\Xml\Request\CalendarMultiGetReport::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}free-busy-query'] = \Sabre\CalDAV\Xml\Request\FreeBusyQueryReport::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}mkcalendar'] = \Sabre\CalDAV\Xml\Request\MkCalendar::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}schedule-calendar-transp'] = \Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp::class; + $server->xml->elementMap['{'.self::NS_CALDAV.'}supported-calendar-component-set'] = \Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet::class; + + $server->resourceTypeMapping[\Sabre\CalDAV\ICalendar::class] = '{urn:ietf:params:xml:ns:caldav}calendar'; + + $server->resourceTypeMapping[\Sabre\CalDAV\Principal\IProxyRead::class] = '{http://calendarserver.org/ns/}calendar-proxy-read'; + $server->resourceTypeMapping[\Sabre\CalDAV\Principal\IProxyWrite::class] = '{http://calendarserver.org/ns/}calendar-proxy-write'; array_push($server->protectedProperties, '{'.self::NS_CALDAV.'}supported-calendar-component-set', diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php index 5bca56d47e..8577ae9f70 100644 --- a/lib/CalDAV/Schedule/Plugin.php +++ b/lib/CalDAV/Schedule/Plugin.php @@ -113,8 +113,8 @@ public function initialize(Server $server) * This information ensures that the {DAV:}resourcetype property has * the correct values. */ - $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IOutbox'] = $ns.'schedule-outbox'; - $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IInbox'] = $ns.'schedule-inbox'; + $server->resourceTypeMapping[\Sabre\CalDAV\Schedule\IOutbox::class] = $ns.'schedule-outbox'; + $server->resourceTypeMapping[\Sabre\CalDAV\Schedule\IInbox::class] = $ns.'schedule-inbox'; /* * Properties we protect are made read-only by the server. diff --git a/lib/CalDAV/SharingPlugin.php b/lib/CalDAV/SharingPlugin.php index bacfe04415..56962fc14f 100644 --- a/lib/CalDAV/SharingPlugin.php +++ b/lib/CalDAV/SharingPlugin.php @@ -83,8 +83,8 @@ public function initialize(DAV\Server $server) '{'.Plugin::NS_CALENDARSERVER.'}shared-url' ); - $this->server->xml->elementMap['{'.Plugin::NS_CALENDARSERVER.'}share'] = 'Sabre\\CalDAV\\Xml\\Request\\Share'; - $this->server->xml->elementMap['{'.Plugin::NS_CALENDARSERVER.'}invite-reply'] = 'Sabre\\CalDAV\\Xml\\Request\\InviteReply'; + $this->server->xml->elementMap['{'.Plugin::NS_CALENDARSERVER.'}share'] = \Sabre\CalDAV\Xml\Request\Share::class; + $this->server->xml->elementMap['{'.Plugin::NS_CALENDARSERVER.'}invite-reply'] = \Sabre\CalDAV\Xml\Request\InviteReply::class; $this->server->on('propFind', [$this, 'propFindEarly']); $this->server->on('propFind', [$this, 'propFindLate'], 150); diff --git a/lib/CalDAV/Subscriptions/Plugin.php b/lib/CalDAV/Subscriptions/Plugin.php index 6cfcc1a7b0..f9b4ae74c2 100644 --- a/lib/CalDAV/Subscriptions/Plugin.php +++ b/lib/CalDAV/Subscriptions/Plugin.php @@ -31,11 +31,11 @@ class Plugin extends ServerPlugin */ public function initialize(Server $server) { - $server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription'] = + $server->resourceTypeMapping[\Sabre\CalDAV\Subscriptions\ISubscription::class] = '{http://calendarserver.org/ns/}subscribed'; $server->xml->elementMap['{http://calendarserver.org/ns/}source'] = - 'Sabre\\DAV\\Xml\\Property\\Href'; + \Sabre\DAV\Xml\Property\Href::class; $server->on('propFind', [$this, 'propFind'], 150); } diff --git a/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php b/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php index 4771a20702..228210de37 100644 --- a/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php +++ b/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php @@ -86,8 +86,8 @@ class CalendarMultiGetReport implements XmlDeserializable public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree([ - '{urn:ietf:params:xml:ns:caldav}calendar-data' => 'Sabre\\CalDAV\\Xml\\Filter\\CalendarData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{urn:ietf:params:xml:ns:caldav}calendar-data' => \Sabre\CalDAV\Xml\Filter\CalendarData::class, + '{DAV:}prop' => \Sabre\Xml\Element\KeyValue::class, ]); $newProps = [ diff --git a/lib/CalDAV/Xml/Request/CalendarQueryReport.php b/lib/CalDAV/Xml/Request/CalendarQueryReport.php index 5a4df46742..3140767c40 100644 --- a/lib/CalDAV/Xml/Request/CalendarQueryReport.php +++ b/lib/CalDAV/Xml/Request/CalendarQueryReport.php @@ -86,11 +86,11 @@ class CalendarQueryReport implements XmlDeserializable public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree([ - '{urn:ietf:params:xml:ns:caldav}comp-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\CompFilter', - '{urn:ietf:params:xml:ns:caldav}prop-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\PropFilter', - '{urn:ietf:params:xml:ns:caldav}param-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\ParamFilter', - '{urn:ietf:params:xml:ns:caldav}calendar-data' => 'Sabre\\CalDAV\\Xml\\Filter\\CalendarData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{urn:ietf:params:xml:ns:caldav}comp-filter' => \Sabre\CalDAV\Xml\Filter\CompFilter::class, + '{urn:ietf:params:xml:ns:caldav}prop-filter' => \Sabre\CalDAV\Xml\Filter\PropFilter::class, + '{urn:ietf:params:xml:ns:caldav}param-filter' => \Sabre\CalDAV\Xml\Filter\ParamFilter::class, + '{urn:ietf:params:xml:ns:caldav}calendar-data' => \Sabre\CalDAV\Xml\Filter\CalendarData::class, + '{DAV:}prop' => \Sabre\Xml\Element\KeyValue::class, ]); $newProps = [ diff --git a/lib/CalDAV/Xml/Request/MkCalendar.php b/lib/CalDAV/Xml/Request/MkCalendar.php index b5701e2ead..58017d8c2d 100644 --- a/lib/CalDAV/Xml/Request/MkCalendar.php +++ b/lib/CalDAV/Xml/Request/MkCalendar.php @@ -62,8 +62,8 @@ public static function xmlDeserialize(Reader $reader) $self = new self(); $elementMap = $reader->elementMap; - $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop'; - $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue'; + $elementMap['{DAV:}prop'] = \Sabre\DAV\Xml\Element\Prop::class; + $elementMap['{DAV:}set'] = \Sabre\Xml\Element\KeyValue::class; $elems = $reader->parseInnerTree($elementMap); foreach ($elems as $elem) { diff --git a/lib/CalDAV/Xml/Request/Share.php b/lib/CalDAV/Xml/Request/Share.php index d597b76f1e..c3ef0f4e39 100644 --- a/lib/CalDAV/Xml/Request/Share.php +++ b/lib/CalDAV/Xml/Request/Share.php @@ -62,8 +62,8 @@ public function __construct(array $sharees) public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseGetElements([ - '{'.Plugin::NS_CALENDARSERVER.'}set' => 'Sabre\\Xml\\Element\\KeyValue', - '{'.Plugin::NS_CALENDARSERVER.'}remove' => 'Sabre\\Xml\\Element\\KeyValue', + '{'.Plugin::NS_CALENDARSERVER.'}set' => \Sabre\Xml\Element\KeyValue::class, + '{'.Plugin::NS_CALENDARSERVER.'}remove' => \Sabre\Xml\Element\KeyValue::class, ]); $sharees = []; diff --git a/lib/CardDAV/Plugin.php b/lib/CardDAV/Plugin.php index 810ae3a1ab..663c561c05 100644 --- a/lib/CardDAV/Plugin.php +++ b/lib/CardDAV/Plugin.php @@ -73,12 +73,12 @@ public function initialize(DAV\Server $server) $server->xml->namespaceMap[self::NS_CARDDAV] = 'card'; - $server->xml->elementMap['{'.self::NS_CARDDAV.'}addressbook-query'] = 'Sabre\\CardDAV\\Xml\\Request\\AddressBookQueryReport'; - $server->xml->elementMap['{'.self::NS_CARDDAV.'}addressbook-multiget'] = 'Sabre\\CardDAV\\Xml\\Request\\AddressBookMultiGetReport'; + $server->xml->elementMap['{'.self::NS_CARDDAV.'}addressbook-query'] = \Sabre\CardDAV\Xml\Request\AddressBookQueryReport::class; + $server->xml->elementMap['{'.self::NS_CARDDAV.'}addressbook-multiget'] = \Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::class; /* Mapping Interfaces to {DAV:}resourcetype values */ - $server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook'] = '{'.self::NS_CARDDAV.'}addressbook'; - $server->resourceTypeMapping['Sabre\\CardDAV\\IDirectory'] = '{'.self::NS_CARDDAV.'}directory'; + $server->resourceTypeMapping[\Sabre\CardDAV\IAddressBook::class] = '{'.self::NS_CARDDAV.'}addressbook'; + $server->resourceTypeMapping[\Sabre\CardDAV\IDirectory::class] = '{'.self::NS_CARDDAV.'}directory'; /* Adding properties that may never be changed */ $server->protectedProperties[] = '{'.self::NS_CARDDAV.'}supported-address-data'; @@ -86,7 +86,7 @@ public function initialize(DAV\Server $server) $server->protectedProperties[] = '{'.self::NS_CARDDAV.'}addressbook-home-set'; $server->protectedProperties[] = '{'.self::NS_CARDDAV.'}supported-collation-set'; - $server->xml->elementMap['{http://calendarserver.org/ns/}me-card'] = 'Sabre\\DAV\\Xml\\Property\\Href'; + $server->xml->elementMap['{http://calendarserver.org/ns/}me-card'] = \Sabre\DAV\Xml\Property\Href::class; $this->server = $server; } diff --git a/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php b/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php index 491f969088..2a67282483 100644 --- a/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php +++ b/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php @@ -83,8 +83,8 @@ class AddressBookMultiGetReport implements XmlDeserializable public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree([ - '{urn:ietf:params:xml:ns:carddav}address-data' => 'Sabre\\CardDAV\\Xml\\Filter\\AddressData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{urn:ietf:params:xml:ns:carddav}address-data' => \Sabre\CardDAV\Xml\Filter\AddressData::class, + '{DAV:}prop' => \Sabre\Xml\Element\KeyValue::class, ]); $newProps = [ diff --git a/lib/CardDAV/Xml/Request/AddressBookQueryReport.php b/lib/CardDAV/Xml/Request/AddressBookQueryReport.php index 02402f6c79..241fd3a848 100644 --- a/lib/CardDAV/Xml/Request/AddressBookQueryReport.php +++ b/lib/CardDAV/Xml/Request/AddressBookQueryReport.php @@ -120,10 +120,10 @@ class AddressBookQueryReport implements XmlDeserializable public static function xmlDeserialize(Reader $reader) { $elems = (array) $reader->parseInnerTree([ - '{urn:ietf:params:xml:ns:carddav}prop-filter' => 'Sabre\\CardDAV\\Xml\\Filter\\PropFilter', - '{urn:ietf:params:xml:ns:carddav}param-filter' => 'Sabre\\CardDAV\\Xml\\Filter\\ParamFilter', - '{urn:ietf:params:xml:ns:carddav}address-data' => 'Sabre\\CardDAV\\Xml\\Filter\\AddressData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{urn:ietf:params:xml:ns:carddav}prop-filter' => \Sabre\CardDAV\Xml\Filter\PropFilter::class, + '{urn:ietf:params:xml:ns:carddav}param-filter' => \Sabre\CardDAV\Xml\Filter\ParamFilter::class, + '{urn:ietf:params:xml:ns:carddav}address-data' => \Sabre\CardDAV\Xml\Filter\AddressData::class, + '{DAV:}prop' => \Sabre\Xml\Element\KeyValue::class, ]); $newProps = [ diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index a8a6f430e4..874bb90b9e 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -499,7 +499,7 @@ public function htmlActionsPanel(DAV\INode $node, &$output, $path) // We also know fairly certain that if an object is a non-extended // SimpleCollection, we won't need to show the panel either. - if ('Sabre\\DAV\\SimpleCollection' === get_class($node)) { + if (\Sabre\DAV\SimpleCollection::class === get_class($node)) { return; } diff --git a/lib/DAV/Locks/Plugin.php b/lib/DAV/Locks/Plugin.php index 2443f204c3..a7e2b44adf 100644 --- a/lib/DAV/Locks/Plugin.php +++ b/lib/DAV/Locks/Plugin.php @@ -55,7 +55,7 @@ public function initialize(DAV\Server $server) { $this->server = $server; - $this->server->xml->elementMap['{DAV:}lockinfo'] = 'Sabre\\DAV\\Xml\\Request\\Lock'; + $this->server->xml->elementMap['{DAV:}lockinfo'] = \Sabre\DAV\Xml\Request\Lock::class; $server->on('method:LOCK', [$this, 'httpLock']); $server->on('method:UNLOCK', [$this, 'httpUnlock']); diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php index 3133e54ad3..5d37dbff9f 100644 --- a/lib/DAV/Server.php +++ b/lib/DAV/Server.php @@ -152,7 +152,7 @@ class Server implements LoggerAwareInterface, EmitterInterface * @var array */ public $resourceTypeMapping = [ - 'Sabre\\DAV\\ICollection' => '{DAV:}collection', + \Sabre\DAV\ICollection::class => '{DAV:}collection', ]; /** diff --git a/lib/DAV/Sharing/Plugin.php b/lib/DAV/Sharing/Plugin.php index d766ae0de9..ea79f4436d 100644 --- a/lib/DAV/Sharing/Plugin.php +++ b/lib/DAV/Sharing/Plugin.php @@ -84,7 +84,7 @@ public function initialize(Server $server) { $this->server = $server; - $server->xml->elementMap['{DAV:}share-resource'] = 'Sabre\\DAV\\Xml\\Request\\ShareResource'; + $server->xml->elementMap['{DAV:}share-resource'] = \Sabre\DAV\Xml\Request\ShareResource::class; array_push( $server->protectedProperties, diff --git a/lib/DAV/Sync/Plugin.php b/lib/DAV/Sync/Plugin.php index 8609f759e5..adce62b808 100644 --- a/lib/DAV/Sync/Plugin.php +++ b/lib/DAV/Sync/Plugin.php @@ -52,7 +52,7 @@ public function getPluginName() public function initialize(DAV\Server $server) { $this->server = $server; - $server->xml->elementMap['{DAV:}sync-collection'] = 'Sabre\\DAV\\Xml\\Request\\SyncCollectionReport'; + $server->xml->elementMap['{DAV:}sync-collection'] = \Sabre\DAV\Xml\Request\SyncCollectionReport::class; $self = $this; diff --git a/lib/DAV/Xml/Element/Prop.php b/lib/DAV/Xml/Element/Prop.php index 9c214792f1..0ea47d6699 100644 --- a/lib/DAV/Xml/Element/Prop.php +++ b/lib/DAV/Xml/Element/Prop.php @@ -85,7 +85,7 @@ private static function parseCurrentElement(Reader $reader) if (array_key_exists($name, $reader->elementMap)) { $deserializer = $reader->elementMap[$name]; - if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) { + if (is_subclass_of($deserializer, \Sabre\Xml\XmlDeserializable::class)) { $value = call_user_func([$deserializer, 'xmlDeserialize'], $reader); } elseif (is_callable($deserializer)) { $value = call_user_func($deserializer, $reader); diff --git a/lib/DAV/Xml/Element/Response.php b/lib/DAV/Xml/Element/Response.php index 86f2d33882..fef3bd7e0e 100644 --- a/lib/DAV/Xml/Element/Response.php +++ b/lib/DAV/Xml/Element/Response.php @@ -184,7 +184,7 @@ public static function xmlDeserialize(Reader $reader) { $reader->pushContext(); - $reader->elementMap['{DAV:}propstat'] = 'Sabre\\Xml\\Element\\KeyValue'; + $reader->elementMap['{DAV:}propstat'] = \Sabre\Xml\Element\KeyValue::class; // We are overriding the parser for {DAV:}prop. This deserializer is // almost identical to the one for Sabre\Xml\Element\KeyValue. diff --git a/lib/DAV/Xml/Element/Sharee.php b/lib/DAV/Xml/Element/Sharee.php index 79d6aa90db..8def16aa4b 100644 --- a/lib/DAV/Xml/Element/Sharee.php +++ b/lib/DAV/Xml/Element/Sharee.php @@ -159,7 +159,7 @@ public static function xmlDeserialize(Reader $reader) { // Temporarily override configuration $reader->pushContext(); - $reader->elementMap['{DAV:}share-access'] = 'Sabre\DAV\Xml\Property\ShareAccess'; + $reader->elementMap['{DAV:}share-access'] = \Sabre\DAV\Xml\Property\ShareAccess::class; $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Deserializer\keyValue'; $elems = Deserializer\keyValue($reader, 'DAV:'); diff --git a/lib/DAV/Xml/Request/Lock.php b/lib/DAV/Xml/Request/Lock.php index 57d12ef93e..70fa46d63e 100644 --- a/lib/DAV/Xml/Request/Lock.php +++ b/lib/DAV/Xml/Request/Lock.php @@ -61,7 +61,7 @@ class Lock implements XmlDeserializable public static function xmlDeserialize(Reader $reader) { $reader->pushContext(); - $reader->elementMap['{DAV:}owner'] = 'Sabre\\Xml\\Element\\XmlFragment'; + $reader->elementMap['{DAV:}owner'] = \Sabre\Xml\Element\XmlFragment::class; $values = KeyValue::xmlDeserialize($reader); diff --git a/lib/DAV/Xml/Request/MkCol.php b/lib/DAV/Xml/Request/MkCol.php index e0d7e90a26..6504aebc0b 100644 --- a/lib/DAV/Xml/Request/MkCol.php +++ b/lib/DAV/Xml/Request/MkCol.php @@ -63,9 +63,9 @@ public static function xmlDeserialize(Reader $reader) $self = new self(); $elementMap = $reader->elementMap; - $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop'; - $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue'; - $elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue'; + $elementMap['{DAV:}prop'] = \Sabre\DAV\Xml\Element\Prop::class; + $elementMap['{DAV:}set'] = \Sabre\Xml\Element\KeyValue::class; + $elementMap['{DAV:}remove'] = \Sabre\Xml\Element\KeyValue::class; $elems = $reader->parseInnerTree($elementMap); diff --git a/lib/DAV/Xml/Request/PropFind.php b/lib/DAV/Xml/Request/PropFind.php index 505e7c79ce..e01dd62f52 100644 --- a/lib/DAV/Xml/Request/PropFind.php +++ b/lib/DAV/Xml/Request/PropFind.php @@ -60,7 +60,7 @@ public static function xmlDeserialize(Reader $reader) $self = new self(); $reader->pushContext(); - $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Element\Elements'; + $reader->elementMap['{DAV:}prop'] = \Sabre\Xml\Element\Elements::class; foreach (KeyValue::xmlDeserialize($reader) as $k => $v) { switch ($k) { diff --git a/lib/DAV/Xml/Request/PropPatch.php b/lib/DAV/Xml/Request/PropPatch.php index c1ed0d3afe..a3b662b91b 100644 --- a/lib/DAV/Xml/Request/PropPatch.php +++ b/lib/DAV/Xml/Request/PropPatch.php @@ -86,9 +86,9 @@ public static function xmlDeserialize(Reader $reader) $self = new self(); $elementMap = $reader->elementMap; - $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop'; - $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue'; - $elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue'; + $elementMap['{DAV:}prop'] = \Sabre\DAV\Xml\Element\Prop::class; + $elementMap['{DAV:}set'] = \Sabre\Xml\Element\KeyValue::class; + $elementMap['{DAV:}remove'] = \Sabre\Xml\Element\KeyValue::class; $elems = $reader->parseInnerTree($elementMap); diff --git a/lib/DAV/Xml/Request/ShareResource.php b/lib/DAV/Xml/Request/ShareResource.php index 79d7dc8264..20614a5364 100644 --- a/lib/DAV/Xml/Request/ShareResource.php +++ b/lib/DAV/Xml/Request/ShareResource.php @@ -61,8 +61,8 @@ public function __construct(array $sharees) public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree([ - '{DAV:}sharee' => 'Sabre\DAV\Xml\Element\Sharee', - '{DAV:}share-access' => 'Sabre\DAV\Xml\Property\ShareAccess', + '{DAV:}sharee' => \Sabre\DAV\Xml\Element\Sharee::class, + '{DAV:}share-access' => \Sabre\DAV\Xml\Property\ShareAccess::class, '{DAV:}prop' => 'Sabre\Xml\Deserializer\keyValue', ]); diff --git a/lib/DAV/Xml/Request/SyncCollectionReport.php b/lib/DAV/Xml/Request/SyncCollectionReport.php index 8dd95765b6..4db06b9efe 100644 --- a/lib/DAV/Xml/Request/SyncCollectionReport.php +++ b/lib/DAV/Xml/Request/SyncCollectionReport.php @@ -76,7 +76,7 @@ public static function xmlDeserialize(Reader $reader) $reader->pushContext(); - $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Element\Elements'; + $reader->elementMap['{DAV:}prop'] = \Sabre\Xml\Element\Elements::class; $elems = KeyValue::xmlDeserialize($reader); $reader->popContext(); diff --git a/lib/DAV/Xml/Response/MultiStatus.php b/lib/DAV/Xml/Response/MultiStatus.php index 8f9d45c80f..bd66a612be 100644 --- a/lib/DAV/Xml/Response/MultiStatus.php +++ b/lib/DAV/Xml/Response/MultiStatus.php @@ -114,7 +114,7 @@ public function xmlSerialize(Writer $writer): void public static function xmlDeserialize(Reader $reader) { $elementMap = $reader->elementMap; - $elementMap['{DAV:}prop'] = 'Sabre\\DAV\\Xml\\Element\\Prop'; + $elementMap['{DAV:}prop'] = \Sabre\DAV\Xml\Element\Prop::class; $elements = $reader->parseInnerTree($elementMap); $responses = []; diff --git a/lib/DAV/Xml/Service.php b/lib/DAV/Xml/Service.php index e718606b96..35bfdd5092 100644 --- a/lib/DAV/Xml/Service.php +++ b/lib/DAV/Xml/Service.php @@ -20,16 +20,16 @@ class Service extends \Sabre\Xml\Service * be mapped to Sabre\DAV\Xml\Request\PropFind */ public array $elementMap = [ - '{DAV:}multistatus' => 'Sabre\\DAV\\Xml\\Response\\MultiStatus', - '{DAV:}response' => 'Sabre\\DAV\\Xml\\Element\\Response', + '{DAV:}multistatus' => \Sabre\DAV\Xml\Response\MultiStatus::class, + '{DAV:}response' => \Sabre\DAV\Xml\Element\Response::class, // Requests - '{DAV:}propfind' => 'Sabre\\DAV\\Xml\\Request\\PropFind', - '{DAV:}propertyupdate' => 'Sabre\\DAV\\Xml\\Request\\PropPatch', - '{DAV:}mkcol' => 'Sabre\\DAV\\Xml\\Request\\MkCol', + '{DAV:}propfind' => \Sabre\DAV\Xml\Request\PropFind::class, + '{DAV:}propertyupdate' => \Sabre\DAV\Xml\Request\PropPatch::class, + '{DAV:}mkcol' => \Sabre\DAV\Xml\Request\MkCol::class, // Properties - '{DAV:}resourcetype' => 'Sabre\\DAV\\Xml\\Property\\ResourceType', + '{DAV:}resourcetype' => \Sabre\DAV\Xml\Property\ResourceType::class, ]; /** diff --git a/lib/DAVACL/Plugin.php b/lib/DAVACL/Plugin.php index f0497844d6..03068451ec 100644 --- a/lib/DAVACL/Plugin.php +++ b/lib/DAVACL/Plugin.php @@ -808,17 +808,17 @@ public function initialize(DAV\Server $server) // Automatically mapping nodes implementing IPrincipal to the // {DAV:}principal resourcetype. - $server->resourceTypeMapping['Sabre\\DAVACL\\IPrincipal'] = '{DAV:}principal'; + $server->resourceTypeMapping[\Sabre\DAVACL\IPrincipal::class] = '{DAV:}principal'; // Mapping the group-member-set property to the HrefList property // class. - $server->xml->elementMap['{DAV:}group-member-set'] = 'Sabre\\DAV\\Xml\\Property\\Href'; - $server->xml->elementMap['{DAV:}acl'] = 'Sabre\\DAVACL\\Xml\\Property\\Acl'; - $server->xml->elementMap['{DAV:}acl-principal-prop-set'] = 'Sabre\\DAVACL\\Xml\\Request\\AclPrincipalPropSetReport'; - $server->xml->elementMap['{DAV:}expand-property'] = 'Sabre\\DAVACL\\Xml\\Request\\ExpandPropertyReport'; - $server->xml->elementMap['{DAV:}principal-property-search'] = 'Sabre\\DAVACL\\Xml\\Request\\PrincipalPropertySearchReport'; - $server->xml->elementMap['{DAV:}principal-search-property-set'] = 'Sabre\\DAVACL\\Xml\\Request\\PrincipalSearchPropertySetReport'; - $server->xml->elementMap['{DAV:}principal-match'] = 'Sabre\\DAVACL\\Xml\\Request\\PrincipalMatchReport'; + $server->xml->elementMap['{DAV:}group-member-set'] = \Sabre\DAV\Xml\Property\Href::class; + $server->xml->elementMap['{DAV:}acl'] = \Sabre\DAVACL\Xml\Property\Acl::class; + $server->xml->elementMap['{DAV:}acl-principal-prop-set'] = \Sabre\DAVACL\Xml\Request\AclPrincipalPropSetReport::class; + $server->xml->elementMap['{DAV:}expand-property'] = \Sabre\DAVACL\Xml\Request\ExpandPropertyReport::class; + $server->xml->elementMap['{DAV:}principal-property-search'] = \Sabre\DAVACL\Xml\Request\PrincipalPropertySearchReport::class; + $server->xml->elementMap['{DAV:}principal-search-property-set'] = \Sabre\DAVACL\Xml\Request\PrincipalSearchPropertySetReport::class; + $server->xml->elementMap['{DAV:}principal-match'] = \Sabre\DAVACL\Xml\Request\PrincipalMatchReport::class; } /* {{{ Event handlers */ diff --git a/lib/DAVACL/Xml/Property/Acl.php b/lib/DAVACL/Xml/Property/Acl.php index 086d123037..519a043020 100644 --- a/lib/DAVACL/Xml/Property/Acl.php +++ b/lib/DAVACL/Xml/Property/Acl.php @@ -161,9 +161,9 @@ public function toHtml(HtmlOutputHelper $html) public static function xmlDeserialize(Reader $reader) { $elementMap = [ - '{DAV:}ace' => 'Sabre\Xml\Element\KeyValue', - '{DAV:}privilege' => 'Sabre\Xml\Element\Elements', - '{DAV:}principal' => 'Sabre\DAVACL\Xml\Property\Principal', + '{DAV:}ace' => \Sabre\Xml\Element\KeyValue::class, + '{DAV:}privilege' => \Sabre\Xml\Element\Elements::class, + '{DAV:}principal' => \Sabre\DAVACL\Xml\Property\Principal::class, ]; $privileges = []; diff --git a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php index 4a7ad25b48..6dcee1ea72 100644 --- a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php +++ b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php @@ -111,7 +111,7 @@ public static function xmlDeserialize(Reader $reader) { $result = []; - $tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']); + $tree = $reader->parseInnerTree(['{DAV:}privilege' => \Sabre\Xml\Element\Elements::class]); foreach ($tree as $element) { if ('{DAV:}privilege' !== $element['name']) { continue; diff --git a/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php b/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php index bddceca8da..1283be102a 100644 --- a/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php +++ b/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php @@ -86,8 +86,8 @@ public static function xmlDeserialize(Reader $reader) } $elemMap = [ - '{DAV:}property-search' => 'Sabre\\Xml\\Element\\KeyValue', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{DAV:}property-search' => \Sabre\Xml\Element\KeyValue::class, + '{DAV:}prop' => \Sabre\Xml\Element\KeyValue::class, ]; foreach ($reader->parseInnerTree($elemMap) as $elem) { diff --git a/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php index 3019dc01d9..8b6de11539 100644 --- a/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php +++ b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php @@ -208,7 +208,7 @@ public function testDeleteCalendarBadID() */ public function testCreateCalendarIncorrectComponentSet() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $backend = new PDO($this->pdo); //Creating a new calendar @@ -309,7 +309,7 @@ public function testGetMultipleObjectsBadId() */ public function testCreateCalendarObjectNoComponent() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $backend = new PDO($this->pdo); $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []); @@ -1025,7 +1025,7 @@ public function testCreateSubscriptions() public function testCreateSubscriptionFail() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $props = [ ]; @@ -1510,7 +1510,7 @@ public function testDeleteSharedCalendar() public function testSetPublishStatus() { - $this->expectException('Sabre\DAV\Exception\NotImplemented'); + $this->expectException(\Sabre\DAV\Exception\NotImplemented::class); $backend = new PDO($this->pdo); $backend->setPublishStatus([1, 1], true); } diff --git a/tests/Sabre/CalDAV/CalendarHomeNotificationsTest.php b/tests/Sabre/CalDAV/CalendarHomeNotificationsTest.php index 6fb0717d71..bbca249235 100644 --- a/tests/Sabre/CalDAV/CalendarHomeNotificationsTest.php +++ b/tests/Sabre/CalDAV/CalendarHomeNotificationsTest.php @@ -19,7 +19,7 @@ public function testGetChildrenNoSupport() public function testGetChildNoSupport() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $backend = new Backend\Mock(); $calendarHome = new CalendarHome($backend, ['uri' => 'principals/user']); $calendarHome->getChild('notifications'); diff --git a/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php b/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php index ce5f6a1102..663ad3b47b 100644 --- a/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php +++ b/tests/Sabre/CalDAV/CalendarHomeSubscriptionsTest.php @@ -61,7 +61,7 @@ public function testCreateSubscription() public function testNoSubscriptionSupport() { - $this->expectException('Sabre\DAV\Exception\InvalidResourceType'); + $this->expectException(\Sabre\DAV\Exception\InvalidResourceType::class); $principal = [ 'uri' => 'principals/user1', ]; diff --git a/tests/Sabre/CalDAV/CalendarHomeTest.php b/tests/Sabre/CalDAV/CalendarHomeTest.php index acbc4ba8f0..96b10c21cf 100644 --- a/tests/Sabre/CalDAV/CalendarHomeTest.php +++ b/tests/Sabre/CalDAV/CalendarHomeTest.php @@ -37,7 +37,7 @@ public function testSimple() */ public function testGetChildNotFound() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->usercalendars->getChild('randomname'); } @@ -91,7 +91,7 @@ public function testGetACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->usercalendars->setACL([]); } @@ -100,7 +100,7 @@ public function testSetACL() */ public function testSetName() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->usercalendars->setName('bla'); } @@ -109,7 +109,7 @@ public function testSetName() */ public function testDelete() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->usercalendars->delete(); } @@ -126,7 +126,7 @@ public function testGetLastModified() */ public function testCreateFile() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->usercalendars->createFile('bla'); } @@ -135,7 +135,7 @@ public function testCreateFile() */ public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->usercalendars->createDirectory('bla'); } @@ -159,7 +159,7 @@ public function testCreateExtendedCollection() */ public function testCreateExtendedCollectionBadResourceType() { - $this->expectException('Sabre\DAV\Exception\InvalidResourceType'); + $this->expectException(\Sabre\DAV\Exception\InvalidResourceType::class); $mkCol = new MkCol( ['{DAV:}collection', '{DAV:}blabla'], [] @@ -172,7 +172,7 @@ public function testCreateExtendedCollectionBadResourceType() */ public function testCreateExtendedCollectionNotACalendar() { - $this->expectException('Sabre\DAV\Exception\InvalidResourceType'); + $this->expectException(\Sabre\DAV\Exception\InvalidResourceType::class); $mkCol = new MkCol( ['{DAV:}collection'], [] @@ -187,7 +187,7 @@ public function testGetSupportedPrivilegesSet() public function testShareReplyFail() { - $this->expectException('Sabre\DAV\Exception\NotImplemented'); + $this->expectException(\Sabre\DAV\Exception\NotImplemented::class); $this->usercalendars->shareReply('uri', DAV\Sharing\Plugin::INVITE_DECLINED, 'curi', '1'); } } diff --git a/tests/Sabre/CalDAV/CalendarObjectTest.php b/tests/Sabre/CalDAV/CalendarObjectTest.php index d8caebab10..3ac118ce19 100644 --- a/tests/Sabre/CalDAV/CalendarObjectTest.php +++ b/tests/Sabre/CalDAV/CalendarObjectTest.php @@ -215,7 +215,7 @@ public function testDefaultACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $children = $this->calendar->getChildren(); self::assertTrue($children[0] instanceof CalendarObject); diff --git a/tests/Sabre/CalDAV/CalendarTest.php b/tests/Sabre/CalDAV/CalendarTest.php index 8d8746afe5..c1bdd23b93 100644 --- a/tests/Sabre/CalDAV/CalendarTest.php +++ b/tests/Sabre/CalDAV/CalendarTest.php @@ -82,7 +82,7 @@ public function testGetProperties() */ public function testGetChildNotFound() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->calendar->getChild('randomname'); } @@ -110,13 +110,13 @@ public function testChildExists() public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->calendar->createDirectory('hello'); } public function testSetName() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->calendar->setName('hello'); } @@ -207,7 +207,7 @@ public function testGetACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->calendar->setACL([]); } diff --git a/tests/Sabre/CalDAV/FreeBusyReportTest.php b/tests/Sabre/CalDAV/FreeBusyReportTest.php index 2aab423611..ddf74b01a4 100644 --- a/tests/Sabre/CalDAV/FreeBusyReportTest.php +++ b/tests/Sabre/CalDAV/FreeBusyReportTest.php @@ -110,7 +110,7 @@ public function testFreeBusyReport() public function testFreeBusyReportNoTimeRange() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $reportXML = << @@ -122,7 +122,7 @@ public function testFreeBusyReportNoTimeRange() public function testFreeBusyReportWrongNode() { - $this->expectException('Sabre\DAV\Exception\NotImplemented'); + $this->expectException(\Sabre\DAV\Exception\NotImplemented::class); $request = new HTTP\Request('REPORT', '/'); $this->server->httpRequest = $request; @@ -139,7 +139,7 @@ public function testFreeBusyReportWrongNode() public function testFreeBusyReportNoACLPlugin() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $this->server = new DAV\Server(); $this->server->httpRequest = new HTTP\Request('REPORT', '/'); $this->plugin = new Plugin(); diff --git a/tests/Sabre/CalDAV/Notifications/CollectionTest.php b/tests/Sabre/CalDAV/Notifications/CollectionTest.php index b5e725d40b..9fc2ab66ae 100644 --- a/tests/Sabre/CalDAV/Notifications/CollectionTest.php +++ b/tests/Sabre/CalDAV/Notifications/CollectionTest.php @@ -65,7 +65,7 @@ public function testGetACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $col = $this->getInstance(); $col->setACL([]); } diff --git a/tests/Sabre/CalDAV/Notifications/NodeTest.php b/tests/Sabre/CalDAV/Notifications/NodeTest.php index cb70c5a213..a5313fc08d 100644 --- a/tests/Sabre/CalDAV/Notifications/NodeTest.php +++ b/tests/Sabre/CalDAV/Notifications/NodeTest.php @@ -75,7 +75,7 @@ public function testGetACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $node = $this->getInstance(); $node->setACL([]); } diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php index 127ad42c5d..695a07e851 100644 --- a/tests/Sabre/CalDAV/PluginTest.php +++ b/tests/Sabre/CalDAV/PluginTest.php @@ -445,22 +445,22 @@ public function testPrincipalProperties() self::assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-home-set', $props[0][200]); $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-home-set']; - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $prop); self::assertEquals('calendars/user1/', $prop->getHref()); self::assertArrayHasKey('{http://calendarserver.org/ns/}calendar-proxy-read-for', $props[0][200]); $prop = $props[0][200]['{http://calendarserver.org/ns/}calendar-proxy-read-for']; - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $prop); self::assertEquals(['principals/admin/'], $prop->getHrefs()); self::assertArrayHasKey('{http://calendarserver.org/ns/}calendar-proxy-write-for', $props[0][200]); $prop = $props[0][200]['{http://calendarserver.org/ns/}calendar-proxy-write-for']; - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $prop); self::assertEquals(['principals/admin/'], $prop->getHrefs()); self::assertArrayHasKey('{'.Plugin::NS_CALENDARSERVER.'}email-address-set', $props[0][200]); $prop = $props[0][200]['{'.Plugin::NS_CALENDARSERVER.'}email-address-set']; - self::assertInstanceOf('Sabre\\CalDAV\\Xml\\Property\\EmailAddressSet', $prop); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\EmailAddressSet::class, $prop); self::assertEquals(['user1.sabredav@sabredav.org'], $prop->getValue()); } @@ -476,7 +476,7 @@ public function testSupportedReportSetPropertyNonCalendar() $prop = $props[0][200]['{DAV:}supported-report-set']; - self::assertInstanceOf('\\Sabre\\DAV\\Xml\\Property\\SupportedReportSet', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\SupportedReportSet::class, $prop); $value = [ '{DAV:}expand-property', '{DAV:}principal-match', @@ -501,7 +501,7 @@ public function testSupportedReportSetProperty() $prop = $props[0][200]['{DAV:}supported-report-set']; - self::assertInstanceOf('\\Sabre\\DAV\\Xml\\Property\\SupportedReportSet', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\SupportedReportSet::class, $prop); $value = [ '{urn:ietf:params:xml:ns:caldav}calendar-multiget', '{urn:ietf:params:xml:ns:caldav}calendar-query', @@ -528,7 +528,7 @@ public function testSupportedReportSetUserCalendars() $prop = $props[0][200]['{DAV:}supported-report-set']; - self::assertInstanceOf('\\Sabre\\DAV\\Xml\\Property\\SupportedReportSet', $prop); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\SupportedReportSet::class, $prop); $value = [ '{DAV:}sync-collection', '{DAV:}expand-property', diff --git a/tests/Sabre/CalDAV/Principal/CollectionTest.php b/tests/Sabre/CalDAV/Principal/CollectionTest.php index 2fdb68d9c1..13ba7ea538 100644 --- a/tests/Sabre/CalDAV/Principal/CollectionTest.php +++ b/tests/Sabre/CalDAV/Principal/CollectionTest.php @@ -15,6 +15,6 @@ public function testGetChildForPrincipal() $r = $col->getChildForPrincipal([ 'uri' => 'principals/admin', ]); - self::assertInstanceOf('Sabre\\CalDAV\\Principal\\User', $r); + self::assertInstanceOf(\Sabre\CalDAV\Principal\User::class, $r); } } diff --git a/tests/Sabre/CalDAV/Principal/ProxyReadTest.php b/tests/Sabre/CalDAV/Principal/ProxyReadTest.php index 02598a3d1d..62c72e932f 100644 --- a/tests/Sabre/CalDAV/Principal/ProxyReadTest.php +++ b/tests/Sabre/CalDAV/Principal/ProxyReadTest.php @@ -41,14 +41,14 @@ public function testGetLastModified() public function testDelete() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $i = $this->getInstance(); $i->delete(); } public function testSetName() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $i = $this->getInstance(); $i->setName('foo'); } diff --git a/tests/Sabre/CalDAV/Principal/UserTest.php b/tests/Sabre/CalDAV/Principal/UserTest.php index 5a6bceec28..cd6ef6fc6c 100644 --- a/tests/Sabre/CalDAV/Principal/UserTest.php +++ b/tests/Sabre/CalDAV/Principal/UserTest.php @@ -28,14 +28,14 @@ public function getInstance() public function testCreateFile() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $u = $this->getInstance(); $u->createFile('test'); } public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $u = $this->getInstance(); $u->createDirectory('test'); } @@ -44,26 +44,26 @@ public function testGetChildProxyRead() { $u = $this->getInstance(); $child = $u->getChild('calendar-proxy-read'); - self::assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $child); + self::assertInstanceOf(\Sabre\CalDAV\Principal\ProxyRead::class, $child); } public function testGetChildProxyWrite() { $u = $this->getInstance(); $child = $u->getChild('calendar-proxy-write'); - self::assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $child); + self::assertInstanceOf(\Sabre\CalDAV\Principal\ProxyWrite::class, $child); } public function testGetChildNotFound() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $u = $this->getInstance(); $child = $u->getChild('foo'); } public function testGetChildNotFound2() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $u = $this->getInstance(); $child = $u->getChild('random'); } @@ -73,8 +73,8 @@ public function testGetChildren() $u = $this->getInstance(); $children = $u->getChildren(); self::assertEquals(2, count($children)); - self::assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $children[0]); - self::assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $children[1]); + self::assertInstanceOf(\Sabre\CalDAV\Principal\ProxyRead::class, $children[0]); + self::assertInstanceOf(\Sabre\CalDAV\Principal\ProxyWrite::class, $children[1]); } public function testChildExist() diff --git a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php index 10d6153739..1b01d9d57a 100644 --- a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php +++ b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php @@ -77,7 +77,7 @@ public function testDelivery() self::assertEquals(1, count($messages)); $message = $messages[0]; - self::assertInstanceOf('\Sabre\VObject\ITip\Message', $message); + self::assertInstanceOf(\Sabre\VObject\ITip\Message::class, $message); self::assertEquals('mailto:user2.sabredav@sabredav.org', $message->recipient); self::assertEquals('Roxy Kesh', $message->recipientName); self::assertEquals('mailto:user1.sabredav@sabredav.org', $message->sender); diff --git a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php index d59075d60e..6bc861fbe6 100644 --- a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php +++ b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php @@ -141,7 +141,7 @@ public function testNotOutbox() public function testNoItipMethod() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->server->httpRequest = new HTTP\Request( 'POST', '/calendars/user1/outbox', @@ -161,7 +161,7 @@ public function testNoItipMethod() public function testNoVFreeBusy() { - $this->expectException('Sabre\DAV\Exception\NotImplemented'); + $this->expectException(\Sabre\DAV\Exception\NotImplemented::class); $this->server->httpRequest = new HTTP\Request( 'POST', '/calendars/user1/outbox', @@ -182,7 +182,7 @@ public function testNoVFreeBusy() public function testIncorrectOrganizer() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->server->httpRequest = new HTTP\Request( 'POST', '/calendars/user1/outbox', @@ -204,7 +204,7 @@ public function testIncorrectOrganizer() public function testNoAttendees() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->server->httpRequest = new HTTP\Request( 'POST', '/calendars/user1/outbox', @@ -226,7 +226,7 @@ public function testNoAttendees() public function testNoDTStart() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->server->httpRequest = new HTTP\Request( 'POST', '/calendars/user1/outbox', diff --git a/tests/Sabre/CalDAV/Schedule/InboxTest.php b/tests/Sabre/CalDAV/Schedule/InboxTest.php index 61998840ec..e1a9a23ddd 100644 --- a/tests/Sabre/CalDAV/Schedule/InboxTest.php +++ b/tests/Sabre/CalDAV/Schedule/InboxTest.php @@ -70,7 +70,7 @@ public function testGetChildren() 1, count($inbox->getChildren()) ); - self::assertInstanceOf('Sabre\CalDAV\Schedule\SchedulingObject', $inbox->getChildren()[0]); + self::assertInstanceOf(\Sabre\CalDAV\Schedule\SchedulingObject::class, $inbox->getChildren()[0]); self::assertEquals( 'schedule1.ics', $inbox->getChildren()[0]->getName() @@ -97,7 +97,7 @@ public function testCreateFile() 1, count($inbox->getChildren()) ); - self::assertInstanceOf('Sabre\CalDAV\Schedule\SchedulingObject', $inbox->getChildren()[0]); + self::assertInstanceOf(\Sabre\CalDAV\Schedule\SchedulingObject::class, $inbox->getChildren()[0]); self::assertEquals( 'schedule1.ics', $inbox->getChildren()[0]->getName() diff --git a/tests/Sabre/CalDAV/Schedule/SchedulingObjectTest.php b/tests/Sabre/CalDAV/Schedule/SchedulingObjectTest.php index 5c15beea0b..732e6d1703 100644 --- a/tests/Sabre/CalDAV/Schedule/SchedulingObjectTest.php +++ b/tests/Sabre/CalDAV/Schedule/SchedulingObjectTest.php @@ -90,7 +90,7 @@ public function testInvalidArg2() */ public function testPut() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $children = $this->inbox->getChildren(); self::assertTrue($children[0] instanceof SchedulingObject); @@ -211,7 +211,7 @@ public function testDefaultACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $children = $this->inbox->getChildren(); self::assertTrue($children[0] instanceof SchedulingObject); diff --git a/tests/Sabre/CalDAV/SharingPluginTest.php b/tests/Sabre/CalDAV/SharingPluginTest.php index 7a58656abd..1d35790df9 100644 --- a/tests/Sabre/CalDAV/SharingPluginTest.php +++ b/tests/Sabre/CalDAV/SharingPluginTest.php @@ -45,7 +45,7 @@ public function setup(): void public function testSimple() { - self::assertInstanceOf('Sabre\\CalDAV\\SharingPlugin', $this->server->getPlugin('caldav-sharing')); + self::assertInstanceOf(\Sabre\CalDAV\SharingPlugin::class, $this->server->getPlugin('caldav-sharing')); self::assertEquals( 'caldav-sharing', $this->caldavSharingPlugin->getPluginInfo()['name'] @@ -75,8 +75,8 @@ public function testBeforeGetShareableCalendar() '{'.Plugin::NS_CALENDARSERVER.'}allowed-sharing-modes', ]); - self::assertInstanceOf('Sabre\\CalDAV\\Xml\\Property\\Invite', $props['{'.Plugin::NS_CALENDARSERVER.'}invite']); - self::assertInstanceOf('Sabre\\CalDAV\\Xml\\Property\\AllowedSharingModes', $props['{'.Plugin::NS_CALENDARSERVER.'}allowed-sharing-modes']); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\Invite::class, $props['{'.Plugin::NS_CALENDARSERVER.'}invite']); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\AllowedSharingModes::class, $props['{'.Plugin::NS_CALENDARSERVER.'}allowed-sharing-modes']); } public function testBeforeGetSharedCalendar() @@ -86,7 +86,7 @@ public function testBeforeGetSharedCalendar() '{'.Plugin::NS_CALENDARSERVER.'}invite', ]); - self::assertInstanceOf('Sabre\\CalDAV\\Xml\\Property\\Invite', $props['{'.Plugin::NS_CALENDARSERVER.'}invite']); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\Invite::class, $props['{'.Plugin::NS_CALENDARSERVER.'}invite']); //self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $props['{' . Plugin::NS_CALENDARSERVER . '}shared-url']); } diff --git a/tests/Sabre/CalDAV/Subscriptions/PluginTest.php b/tests/Sabre/CalDAV/Subscriptions/PluginTest.php index 7f59d7cbb7..3649735c43 100644 --- a/tests/Sabre/CalDAV/Subscriptions/PluginTest.php +++ b/tests/Sabre/CalDAV/Subscriptions/PluginTest.php @@ -17,10 +17,10 @@ public function testInit() self::assertEquals( '{http://calendarserver.org/ns/}subscribed', - $server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription'] + $server->resourceTypeMapping[\Sabre\CalDAV\Subscriptions\ISubscription::class] ); self::assertEquals( - 'Sabre\\DAV\\Xml\\Property\\Href', + \Sabre\DAV\Xml\Property\Href::class, $server->xml->elementMap['{http://calendarserver.org/ns/}source'] ); diff --git a/tests/Sabre/CalDAV/Subscriptions/SubscriptionTest.php b/tests/Sabre/CalDAV/Subscriptions/SubscriptionTest.php index ec89626677..541f625c67 100644 --- a/tests/Sabre/CalDAV/Subscriptions/SubscriptionTest.php +++ b/tests/Sabre/CalDAV/Subscriptions/SubscriptionTest.php @@ -84,7 +84,7 @@ public function testValues2() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $sub = $this->getSub(); $sub->setACL([]); } diff --git a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php index 77d8851277..51ba9e8144 100644 --- a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php @@ -12,7 +12,7 @@ class AllowedSharingModesTest extends DAV\Xml\AbstractXmlTestCase public function testSimple() { $sccs = new AllowedSharingModes(true, true); - self::assertInstanceOf('Sabre\CalDAV\Xml\Property\AllowedSharingModes', $sccs); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\AllowedSharingModes::class, $sccs); } /** diff --git a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php index 309b28291c..0ead38a7b4 100644 --- a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php @@ -20,7 +20,7 @@ public function setup(): void public function testSimple() { $invite = new Invite([]); - self::assertInstanceOf('Sabre\CalDAV\Xml\Property\Invite', $invite); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\Invite::class, $invite); self::assertEquals([], $invite->getValue()); } diff --git a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php index c2f76b8ae3..3619d23248 100644 --- a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php @@ -76,7 +76,7 @@ public function testUnserializeTransparent() $result = $this->parse( $xml, - ['{DAV:}root' => 'Sabre\\CalDAV\\Xml\\Property\\ScheduleCalendarTransp'] + ['{DAV:}root' => \Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp::class] ); self::assertEquals( @@ -99,7 +99,7 @@ public function testUnserializeOpaque() $result = $this->parse( $xml, - ['{DAV:}root' => 'Sabre\\CalDAV\\Xml\\Property\\ScheduleCalendarTransp'] + ['{DAV:}root' => \Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp::class] ); self::assertEquals( diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php index 9f60c40dd8..490bf5d21e 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php @@ -66,7 +66,7 @@ public function testUnserialize() $result = $this->parse( $xml, - ['{DAV:}root' => 'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'] + ['{DAV:}root' => \Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet::class] ); self::assertEquals( @@ -77,7 +77,7 @@ public function testUnserialize() public function testUnserializeEmpty() { - $this->expectException('Sabre\Xml\ParseException'); + $this->expectException(\Sabre\Xml\ParseException::class); $cal = CalDAV\Plugin::NS_CALDAV; $cs = CalDAV\Plugin::NS_CALENDARSERVER; @@ -89,7 +89,7 @@ public function testUnserializeEmpty() $result = $this->parse( $xml, - ['{DAV:}root' => 'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'] + ['{DAV:}root' => \Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet::class] ); } } diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php index 51f558e178..f18623d053 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php @@ -12,7 +12,7 @@ class SupportedCalendarDataTest extends DAV\Xml\AbstractXmlTestCase public function testSimple() { $sccs = new SupportedCalendarData(); - self::assertInstanceOf('Sabre\CalDAV\Xml\Property\SupportedCalendarData', $sccs); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\SupportedCalendarData::class, $sccs); } /** diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php index a1f18342ec..44f342e3d4 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php @@ -12,7 +12,7 @@ class SupportedCollationSetTest extends DAV\Xml\AbstractXmlTestCase public function testSimple() { $scs = new SupportedCollationSet(); - self::assertInstanceOf('Sabre\CalDAV\Xml\Property\SupportedCollationSet', $scs); + self::assertInstanceOf(\Sabre\CalDAV\Xml\Property\SupportedCollationSet::class, $scs); } /** diff --git a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php index 8172c906fe..7c9459b869 100644 --- a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php @@ -11,7 +11,7 @@ class CalendarQueryReportTest extends AbstractXmlTestCase { protected $elementMap = [ - '{urn:ietf:params:xml:ns:caldav}calendar-query' => 'Sabre\\CalDAV\\Xml\\Request\CalendarQueryReport', + '{urn:ietf:params:xml:ns:caldav}calendar-query' => \Sabre\CalDAV\Xml\Request\CalendarQueryReport::class, ]; public function testDeserialize() @@ -49,7 +49,7 @@ public function testDeserialize() public function testDeserializeNoFilter() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -215,7 +215,7 @@ public function testDeserializeComplex() public function testDeserializeDoubleTopCompFilter() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -237,7 +237,7 @@ public function testDeserializeDoubleTopCompFilter() public function testDeserializeMissingExpandEnd() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -258,7 +258,7 @@ public function testDeserializeMissingExpandEnd() public function testDeserializeExpandEndBeforeStart() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -279,7 +279,7 @@ public function testDeserializeExpandEndBeforeStart() public function testDeserializeTimeRangeOnVCALENDAR() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -300,7 +300,7 @@ public function testDeserializeTimeRangeOnVCALENDAR() public function testDeserializeTimeRangeEndBeforeStart() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -323,7 +323,7 @@ public function testDeserializeTimeRangeEndBeforeStart() public function testDeserializeTimeRangePropEndBeforeStart() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << diff --git a/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php b/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php index baf07681d5..2d09e1d0d4 100644 --- a/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/InviteReplyTest.php @@ -10,7 +10,7 @@ class InviteReplyTest extends AbstractXmlTestCase { protected $elementMap = [ - '{http://calendarserver.org/ns/}invite-reply' => 'Sabre\\CalDAV\\Xml\\Request\\InviteReply', + '{http://calendarserver.org/ns/}invite-reply' => \Sabre\CalDAV\Xml\Request\InviteReply::class, ]; public function testDeserialize() @@ -59,7 +59,7 @@ public function testDeserializeDeclined() public function testDeserializeNoHostUrl() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << diff --git a/tests/Sabre/CalDAV/Xml/Request/ShareTest.php b/tests/Sabre/CalDAV/Xml/Request/ShareTest.php index 0d696f17b8..93ee695f67 100644 --- a/tests/Sabre/CalDAV/Xml/Request/ShareTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/ShareTest.php @@ -10,7 +10,7 @@ class ShareTest extends AbstractXmlTestCase { protected $elementMap = [ - '{http://calendarserver.org/ns/}share' => 'Sabre\\CalDAV\\Xml\\Request\\Share', + '{http://calendarserver.org/ns/}share' => \Sabre\CalDAV\Xml\Request\Share::class, ]; public function testDeserialize() diff --git a/tests/Sabre/CardDAV/AddressBookHomeTest.php b/tests/Sabre/CardDAV/AddressBookHomeTest.php index 86c72c08d1..5f54a2f980 100644 --- a/tests/Sabre/CardDAV/AddressBookHomeTest.php +++ b/tests/Sabre/CardDAV/AddressBookHomeTest.php @@ -30,13 +30,13 @@ public function testGetName() public function testSetName() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->s->setName('user2'); } public function testDelete() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->s->delete(); } @@ -47,26 +47,26 @@ public function testGetLastModified() public function testCreateFile() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->s->createFile('bla'); } public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->s->createDirectory('bla'); } public function testGetChild() { $child = $this->s->getChild('book1'); - self::assertInstanceOf('Sabre\\CardDAV\\AddressBook', $child); + self::assertInstanceOf(\Sabre\CardDAV\AddressBook::class, $child); self::assertEquals('book1', $child->getName()); } public function testGetChild404() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->s->getChild('book2'); } @@ -74,7 +74,7 @@ public function testGetChildren() { $children = $this->s->getChildren(); self::assertEquals(2, count($children)); - self::assertInstanceOf('Sabre\\CardDAV\\AddressBook', $children[0]); + self::assertInstanceOf(\Sabre\CardDAV\AddressBook::class, $children[0]); self::assertEquals('book1', $children[0]->getName()); } @@ -96,7 +96,7 @@ public function testCreateExtendedCollection() public function testCreateExtendedCollectionInvalid() { - $this->expectException('Sabre\DAV\Exception\InvalidResourceType'); + $this->expectException(\Sabre\DAV\Exception\InvalidResourceType::class); $resourceType = [ '{DAV:}collection', ]; @@ -118,7 +118,7 @@ public function testACLMethods() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->s->setACL([]); } diff --git a/tests/Sabre/CardDAV/AddressBookRootTest.php b/tests/Sabre/CardDAV/AddressBookRootTest.php index a928a5796e..61fdb35ce5 100644 --- a/tests/Sabre/CardDAV/AddressBookRootTest.php +++ b/tests/Sabre/CardDAV/AddressBookRootTest.php @@ -25,7 +25,7 @@ public function testGetChildForPrincipal() $children = $root->getChildren(); self::assertEquals(3, count($children)); - self::assertInstanceOf('Sabre\\CardDAV\\AddressBookHome', $children[0]); + self::assertInstanceOf(\Sabre\CardDAV\AddressBookHome::class, $children[0]); self::assertEquals('user1', $children[0]->getName()); } } diff --git a/tests/Sabre/CardDAV/AddressBookTest.php b/tests/Sabre/CardDAV/AddressBookTest.php index 326922abe3..1df0f0fdcd 100644 --- a/tests/Sabre/CardDAV/AddressBookTest.php +++ b/tests/Sabre/CardDAV/AddressBookTest.php @@ -38,13 +38,13 @@ public function testGetName() public function testGetChild() { $card = $this->ab->getChild('card1'); - self::assertInstanceOf('Sabre\\CardDAV\\Card', $card); + self::assertInstanceOf(\Sabre\CardDAV\Card::class, $card); self::assertEquals('card1', $card->getName()); } public function testGetChildNotFound() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $card = $this->ab->getChild('card3'); } @@ -59,7 +59,7 @@ public function testGetChildren() public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->ab->createDirectory('name'); } @@ -81,7 +81,7 @@ public function testDelete() public function testSetName() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->ab->setName('foo'); } @@ -124,7 +124,7 @@ public function testACLMethods() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->ab->setACL([]); } diff --git a/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php b/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php index aa77b4b1f4..9af47b8c74 100644 --- a/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php +++ b/tests/Sabre/CardDAV/Backend/AbstractPDOTestCase.php @@ -146,7 +146,7 @@ public function testDeleteAddressBook() public function testCreateAddressBookUnsupportedProp() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->backend->createAddressBook('principals/user1', 'book2', [ '{DAV:}foo' => 'bar', ]); diff --git a/tests/Sabre/CardDAV/CardTest.php b/tests/Sabre/CardDAV/CardTest.php index dea2a786cc..acd0eb949b 100644 --- a/tests/Sabre/CardDAV/CardTest.php +++ b/tests/Sabre/CardDAV/CardTest.php @@ -181,7 +181,7 @@ public function testOverrideACL() public function testSetACL() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->card->setACL([]); } diff --git a/tests/Sabre/CardDAV/PluginTest.php b/tests/Sabre/CardDAV/PluginTest.php index 6d7d01fcaf..9d17227c5f 100644 --- a/tests/Sabre/CardDAV/PluginTest.php +++ b/tests/Sabre/CardDAV/PluginTest.php @@ -10,7 +10,7 @@ class PluginTest extends AbstractPluginTestCase { public function testConstruct() { - self::assertEquals('{'.Plugin::NS_CARDDAV.'}addressbook', $this->server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook']); + self::assertEquals('{'.Plugin::NS_CARDDAV.'}addressbook', $this->server->resourceTypeMapping[\Sabre\CardDAV\IAddressBook::class]); self::assertContains('addressbook', $this->plugin->getFeatures()); self::assertEquals('carddav', $this->plugin->getPluginInfo()['name']); @@ -73,11 +73,11 @@ public function testAddressbookPluginProperties() $this->plugin->propFindEarly($propFind, $node); self::assertInstanceOf( - 'Sabre\\CardDAV\\Xml\\Property\\SupportedAddressData', + \Sabre\CardDAV\Xml\Property\SupportedAddressData::class, $propFind->get($ns.'supported-address-data') ); self::assertInstanceOf( - 'Sabre\\CardDAV\\Xml\\Property\\SupportedCollationSet', + \Sabre\CardDAV\Xml\Property\SupportedCollationSet::class, $propFind->get($ns.'supported-collation-set') ); } diff --git a/tests/Sabre/CardDAV/VCFExportTest.php b/tests/Sabre/CardDAV/VCFExportTest.php index 65e3742225..e38fee6e3d 100644 --- a/tests/Sabre/CardDAV/VCFExportTest.php +++ b/tests/Sabre/CardDAV/VCFExportTest.php @@ -40,7 +40,7 @@ public function setup(): void public function testSimple() { $plugin = $this->server->getPlugin('vcf-export'); - self::assertInstanceOf('Sabre\\CardDAV\\VCFExportPlugin', $plugin); + self::assertInstanceOf(\Sabre\CardDAV\VCFExportPlugin::class, $plugin); self::assertEquals( 'vcf-export', diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php index ed8c99ad0b..8c3bb1b628 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php @@ -12,7 +12,7 @@ class SupportedAddressDataTest extends DAV\Xml\AbstractXmlTestCase public function testSimple() { $property = new SupportedAddressData(); - self::assertInstanceOf('Sabre\CardDAV\Xml\Property\SupportedAddressData', $property); + self::assertInstanceOf(\Sabre\CardDAV\Xml\Property\SupportedAddressData::class, $property); } /** diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php index e4f58139d5..1580a78276 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php @@ -12,7 +12,7 @@ class SupportedCollationSetTest extends DAV\Xml\AbstractXmlTestCase public function testSimple() { $property = new SupportedCollationSet(); - self::assertInstanceOf('Sabre\CardDAV\Xml\Property\SupportedCollationSet', $property); + self::assertInstanceOf(\Sabre\CardDAV\Xml\Property\SupportedCollationSet::class, $property); } /** diff --git a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php index d1d612329c..f9398a53d9 100644 --- a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php +++ b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php @@ -7,7 +7,7 @@ class AddressBookMultiGetReportTest extends AbstractXmlTestCase { protected $elementMap = [ - '{urn:ietf:params:xml:ns:carddav}addressbook-multiget' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookMultiGetReport', + '{urn:ietf:params:xml:ns:carddav}addressbook-multiget' => \Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::class, ]; /** diff --git a/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php b/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php index b2dbab4e93..15d1d472e7 100644 --- a/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php +++ b/tests/Sabre/CardDAV/Xml/Request/AddressBookQueryReportTest.php @@ -9,7 +9,7 @@ class AddressBookQueryReportTest extends AbstractXmlTestCase { protected $elementMap = [ - '{urn:ietf:params:xml:ns:carddav}addressbook-query' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookQueryReport', + '{urn:ietf:params:xml:ns:carddav}addressbook-query' => \Sabre\CardDAV\Xml\Request\AddressBookQueryReport::class, ]; public function testDeserialize() @@ -86,7 +86,7 @@ public function testDeserializeAllOf() public function testDeserializeBadTest() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -231,7 +231,7 @@ public function testDeserializeComplex() public function testDeserializeBadMatchType() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -252,7 +252,7 @@ public function testDeserializeBadMatchType() public function testDeserializeBadMatchType2() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -271,7 +271,7 @@ public function testDeserializeBadMatchType2() public function testDeserializeDoubleFilter() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php index a1847998b1..b029884b39 100644 --- a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php +++ b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php @@ -37,7 +37,7 @@ public function testCheckBadGetUserInfoResponse() public function testCheckBadGetUserInfoResponse2() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $header = 'username=array, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1'; $request = HTTP\Sapi::createFromServerArray([ 'REQUEST_METHOD' => 'GET', diff --git a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php index 2cfba283d5..0b7c8d4692 100644 --- a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php +++ b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php @@ -11,7 +11,7 @@ class ApacheTest extends \PHPUnit\Framework\TestCase public function testConstruct() { $backend = new Apache(); - self::assertInstanceOf('Sabre\DAV\Auth\Backend\Apache', $backend); + self::assertInstanceOf(\Sabre\DAV\Auth\Backend\Apache::class, $backend); } public function testNoHeader() diff --git a/tests/Sabre/DAV/Auth/Backend/FileTest.php b/tests/Sabre/DAV/Auth/Backend/FileTest.php index 46b253c79f..87d99aca23 100644 --- a/tests/Sabre/DAV/Auth/Backend/FileTest.php +++ b/tests/Sabre/DAV/Auth/Backend/FileTest.php @@ -21,7 +21,7 @@ public function testConstruct() public function testLoadFileBroken() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); file_put_contents(\Sabre\TestUtil::SABRE_TEMPDIR.'/backend', 'user:realm:hash'); $file = new File(\Sabre\TestUtil::SABRE_TEMPDIR.'/backend'); } diff --git a/tests/Sabre/DAV/Auth/PluginTest.php b/tests/Sabre/DAV/Auth/PluginTest.php index a680817bca..aae42e9a08 100644 --- a/tests/Sabre/DAV/Auth/PluginTest.php +++ b/tests/Sabre/DAV/Auth/PluginTest.php @@ -37,7 +37,7 @@ public function testAuthenticate() */ public function testAuthenticateFail() { - $this->expectException('Sabre\DAV\Exception\NotAuthenticated'); + $this->expectException(\Sabre\DAV\Exception\NotAuthenticated::class); $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend = new Backend\Mock(); $backend->fail = true; @@ -90,7 +90,7 @@ public function testMultipleBackend() */ public function testNoAuthBackend() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $plugin = new Plugin(); @@ -103,7 +103,7 @@ public function testNoAuthBackend() */ public function testInvalidCheckResponse() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend = new Backend\Mock(); $backend->invalidCheckResponse = true; diff --git a/tests/Sabre/DAV/BasicNodeTest.php b/tests/Sabre/DAV/BasicNodeTest.php index a58a25d823..faf49c1032 100644 --- a/tests/Sabre/DAV/BasicNodeTest.php +++ b/tests/Sabre/DAV/BasicNodeTest.php @@ -8,14 +8,14 @@ class BasicNodeTest extends \PHPUnit\Framework\TestCase { public function testPut() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $file = new FileMock(); $file->put('hi'); } public function testGet() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $file = new FileMock(); $file->get(); } @@ -40,14 +40,14 @@ public function testGetContentType() public function testDelete() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $file = new FileMock(); $file->delete(); } public function testSetName() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $file = new FileMock(); $file->setName('hi'); } @@ -82,21 +82,21 @@ public function testChildExistsFalse() public function testGetChild404() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $dir = new DirectoryMock(); $file = $dir->getChild('blabla'); } public function testCreateFile() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $dir = new DirectoryMock(); $dir->createFile('hello', 'data'); } public function testCreateDirectory() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $dir = new DirectoryMock(); $dir->createDirectory('hello'); } diff --git a/tests/Sabre/DAV/ClientTest.php b/tests/Sabre/DAV/ClientTest.php index e19ec07b44..6d15a50394 100644 --- a/tests/Sabre/DAV/ClientTest.php +++ b/tests/Sabre/DAV/ClientTest.php @@ -20,7 +20,7 @@ public function testConstruct() $client = new ClientMock([ 'baseUri' => '/', ]); - self::assertInstanceOf('Sabre\DAV\ClientMock', $client); + self::assertInstanceOf(\Sabre\DAV\ClientMock::class, $client); } public function testConstructNoBaseUri() @@ -137,7 +137,7 @@ public function testPropFind() public function testPropFindError() { - $this->expectException('Sabre\HTTP\ClientHttpException'); + $this->expectException(\Sabre\HTTP\ClientHttpException::class); $client = new ClientMock([ 'baseUri' => '/', ]); @@ -504,7 +504,7 @@ public function testPropPatch() */ public function testPropPatchHTTPError() { - $this->expectException('Sabre\HTTP\ClientHttpException'); + $this->expectException(\Sabre\HTTP\ClientHttpException::class); $client = new ClientMock([ 'baseUri' => '/', ]); @@ -518,7 +518,7 @@ public function testPropPatchHTTPError() */ public function testPropPatchMultiStatusError() { - $this->expectException('Sabre\HTTP\ClientException'); + $this->expectException(\Sabre\HTTP\ClientException::class); $client = new ClientMock([ 'baseUri' => '/', ]); diff --git a/tests/Sabre/DAV/ExceptionTest.php b/tests/Sabre/DAV/ExceptionTest.php index 47f0b99c4a..09b74b4e4a 100644 --- a/tests/Sabre/DAV/ExceptionTest.php +++ b/tests/Sabre/DAV/ExceptionTest.php @@ -15,8 +15,8 @@ public function testStatus() public function testExceptionStatuses() { $c = [ - 'Sabre\\DAV\\Exception\\NotAuthenticated' => 401, - 'Sabre\\DAV\\Exception\\InsufficientStorage' => 507, + \Sabre\DAV\Exception\NotAuthenticated::class => 401, + \Sabre\DAV\Exception\InsufficientStorage::class => 507, ]; foreach ($c as $class => $status) { diff --git a/tests/Sabre/DAV/FS/NodeTest.php b/tests/Sabre/DAV/FS/NodeTest.php index 1b36f8a52b..47b7e7af9c 100644 --- a/tests/Sabre/DAV/FS/NodeTest.php +++ b/tests/Sabre/DAV/FS/NodeTest.php @@ -23,7 +23,7 @@ public function testConstructOverrideName() public function testOverrideNameSetName() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $node = new File(__FILE__, 'foo.txt'); $node->setName('foo2.txt'); } diff --git a/tests/Sabre/DAV/FSExt/DirectoryTest.php b/tests/Sabre/DAV/FSExt/DirectoryTest.php index aecd9580f5..d134f4fce8 100644 --- a/tests/Sabre/DAV/FSExt/DirectoryTest.php +++ b/tests/Sabre/DAV/FSExt/DirectoryTest.php @@ -19,7 +19,7 @@ public function testCreate() public function testChildExistDot() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $dir = $this->create(); $dir->childExists('..'); } diff --git a/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php index 73425e6b8f..2237131056 100644 --- a/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php @@ -19,7 +19,7 @@ abstract public function getBackend(); public function testSetup() { $backend = $this->getBackend(); - self::assertInstanceOf('Sabre\\DAV\\Locks\\Backend\\AbstractBackend', $backend); + self::assertInstanceOf(\Sabre\DAV\Locks\Backend\AbstractBackend::class, $backend); } /** diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php index 66f16abd81..465bbc1609 100644 --- a/tests/Sabre/DAV/Locks/PluginTest.php +++ b/tests/Sabre/DAV/Locks/PluginTest.php @@ -914,7 +914,7 @@ public function testGetTimeoutHeaderInfinite() public function testGetTimeoutHeaderInvalid() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $request = new HTTP\Request('GET', '/', ['Timeout' => 'yourmom']); $this->server->httpRequest = $request; diff --git a/tests/Sabre/DAV/ObjectTreeTest.php b/tests/Sabre/DAV/ObjectTreeTest.php index 682a8c38cd..278730eee5 100644 --- a/tests/Sabre/DAV/ObjectTreeTest.php +++ b/tests/Sabre/DAV/ObjectTreeTest.php @@ -27,13 +27,13 @@ public function teardown(): void public function testGetRootNode() { $root = $this->tree->getNodeForPath(''); - self::assertInstanceOf('Sabre\\DAV\\FSExt\\Directory', $root); + self::assertInstanceOf(\Sabre\DAV\FSExt\Directory::class, $root); } public function testGetSubDir() { $root = $this->tree->getNodeForPath('subdir'); - self::assertInstanceOf('Sabre\\DAV\\FSExt\\Directory', $root); + self::assertInstanceOf(\Sabre\DAV\FSExt\Directory::class, $root); } public function testCopyFile() diff --git a/tests/Sabre/DAV/PSR3Test.php b/tests/Sabre/DAV/PSR3Test.php index d029b38fe7..d555e8fcc1 100644 --- a/tests/Sabre/DAV/PSR3Test.php +++ b/tests/Sabre/DAV/PSR3Test.php @@ -10,7 +10,7 @@ public function testIsLoggerAware() { $server = new Server(); self::assertInstanceOf( - 'Psr\Log\LoggerAwareInterface', + \Psr\Log\LoggerAwareInterface::class, $server ); } @@ -19,7 +19,7 @@ public function testGetNullLoggerByDefault() { $server = new Server(); self::assertInstanceOf( - 'Psr\Log\NullLogger', + \Psr\Log\NullLogger::class, $server->getLogger() ); } diff --git a/tests/Sabre/DAV/ServerEventsTest.php b/tests/Sabre/DAV/ServerEventsTest.php index cee10e6552..753e390c35 100644 --- a/tests/Sabre/DAV/ServerEventsTest.php +++ b/tests/Sabre/DAV/ServerEventsTest.php @@ -159,7 +159,7 @@ public function testException() $this->server->httpRequest = $req; $this->server->exec(); - self::assertInstanceOf('Sabre\\DAV\\Exception\\NotFound', $this->exception); + self::assertInstanceOf(\Sabre\DAV\Exception\NotFound::class, $this->exception); } public function exceptionHandler(Exception $exception) diff --git a/tests/Sabre/DAV/ServerPluginTest.php b/tests/Sabre/DAV/ServerPluginTest.php index 19d99b9953..d33c411587 100644 --- a/tests/Sabre/DAV/ServerPluginTest.php +++ b/tests/Sabre/DAV/ServerPluginTest.php @@ -29,7 +29,7 @@ public function testBaseClass() self::assertEquals([], $p->getHTTPMethods('')); self::assertEquals( [ - 'name' => 'Sabre\DAV\ServerPluginMock', + 'name' => \Sabre\DAV\ServerPluginMock::class, 'description' => null, 'link' => null, ], $p->getPluginInfo() diff --git a/tests/Sabre/DAV/ServerPreconditionsTest.php b/tests/Sabre/DAV/ServerPreconditionsTest.php index b662bb13a7..1ae9d5c182 100644 --- a/tests/Sabre/DAV/ServerPreconditionsTest.php +++ b/tests/Sabre/DAV/ServerPreconditionsTest.php @@ -10,7 +10,7 @@ class ServerPreconditionsTest extends \PHPUnit\Framework\TestCase { public function testIfMatchNoNode() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('GET', '/bar', ['If-Match' => '*']); @@ -29,7 +29,7 @@ public function testIfMatchHasNode() public function testIfMatchWrongEtag() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '1234']); @@ -80,7 +80,7 @@ public function testIfNoneMatchNoNode() public function testIfNoneMatchHasNode() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '*']); @@ -108,7 +108,7 @@ public function testIfNoneMatchWrongEtagMultiple() public function testIfNoneMatchCorrectEtag() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"abc123"']); @@ -118,7 +118,7 @@ public function testIfNoneMatchCorrectEtag() public function testIfNoneMatchCorrectEtagMultiple() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234, "abc123"']); @@ -227,7 +227,7 @@ public function testIfUnmodifiedSinceUnModified() public function testIfUnmodifiedSinceModified() { - $this->expectException('Sabre\DAV\Exception\PreconditionFailed'); + $this->expectException(\Sabre\DAV\Exception\PreconditionFailed::class); $root = new SimpleCollection('root', [new ServerPreconditionsNode()]); $server = new Server($root); $httpRequest = new HTTP\Request('GET', '/foo', [ diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php index 9f741879d9..8683e5c129 100644 --- a/tests/Sabre/DAV/ServerSimpleTest.php +++ b/tests/Sabre/DAV/ServerSimpleTest.php @@ -20,7 +20,7 @@ public function testConstructArray() public function testConstructInvalidArg() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $server = new Server(1); } @@ -189,7 +189,7 @@ public function testCalculateUriSpecialChars() public function testCalculateUriBreakout() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $uri = '/path1/'; $this->server->setBaseUri('/path2/'); @@ -310,7 +310,7 @@ public function testGuessBaseUriQueryString() */ public function testGuessBaseUriBadConfig() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $serverVars = [ 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/index.php/root/heyyy', diff --git a/tests/Sabre/DAV/Sharing/PluginTest.php b/tests/Sabre/DAV/Sharing/PluginTest.php index 2da35529c9..9496943937 100644 --- a/tests/Sabre/DAV/Sharing/PluginTest.php +++ b/tests/Sabre/DAV/Sharing/PluginTest.php @@ -129,7 +129,7 @@ public function testBrowserPostActionSuccess() public function testBrowserPostActionNoHref() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->sharingPlugin->browserPostAction( 'shareable', 'share', @@ -141,7 +141,7 @@ public function testBrowserPostActionNoHref() public function testBrowserPostActionNoAccess() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->sharingPlugin->browserPostAction( 'shareable', 'share', @@ -153,7 +153,7 @@ public function testBrowserPostActionNoAccess() public function testBrowserPostActionBadAccess() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->sharingPlugin->browserPostAction( 'shareable', 'share', @@ -166,7 +166,7 @@ public function testBrowserPostActionBadAccess() public function testBrowserPostActionAccessDenied() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->aclPlugin->setDefaultAcl([]); $this->sharingPlugin->browserPostAction( 'shareable', diff --git a/tests/Sabre/DAV/SimpleCollectionTest.php b/tests/Sabre/DAV/SimpleCollectionTest.php index ec321721b8..f55430971d 100644 --- a/tests/Sabre/DAV/SimpleCollectionTest.php +++ b/tests/Sabre/DAV/SimpleCollectionTest.php @@ -42,7 +42,7 @@ public function testGetChildren() public function testGetChild404() { - $this->expectException('Sabre\DAV\Exception\NotFound'); + $this->expectException(\Sabre\DAV\Exception\NotFound::class); $s = new SimpleCollection('foo', []); $s->getChild('404'); } diff --git a/tests/Sabre/DAV/StringUtilTest.php b/tests/Sabre/DAV/StringUtilTest.php index b263605c83..0adcef5b61 100644 --- a/tests/Sabre/DAV/StringUtilTest.php +++ b/tests/Sabre/DAV/StringUtilTest.php @@ -74,13 +74,13 @@ public function dataset() public function testBadCollation() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); StringUtil::textMatch('foobar', 'foo', 'blabla', 'contains'); } public function testBadMatchType() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); StringUtil::textMatch('foobar', 'foo', 'i;octet', 'booh'); } diff --git a/tests/Sabre/DAV/Xml/Element/PropTest.php b/tests/Sabre/DAV/Xml/Element/PropTest.php index 939addedae..a003b6625d 100644 --- a/tests/Sabre/DAV/Xml/Element/PropTest.php +++ b/tests/Sabre/DAV/Xml/Element/PropTest.php @@ -69,7 +69,7 @@ public function testDeserializeCustom() ]; $elementMap = [ - '{DAV:}foo' => 'Sabre\DAV\Xml\Property\Href', + '{DAV:}foo' => \Sabre\DAV\Xml\Property\Href::class, ]; self::assertDecodeProp($input, $expected, $elementMap); @@ -139,7 +139,7 @@ public function testDeserializeCustomBadObj() public function assertDecodeProp($input, array $expected, array $elementMap = []) { - $elementMap['{DAV:}root'] = 'Sabre\DAV\Xml\Element\Prop'; + $elementMap['{DAV:}root'] = \Sabre\DAV\Xml\Element\Prop::class; $result = $this->parse($input, $elementMap); self::assertIsArray($result); diff --git a/tests/Sabre/DAV/Xml/Element/ResponseTest.php b/tests/Sabre/DAV/Xml/Element/ResponseTest.php index 9863475ccd..2a65dde89e 100644 --- a/tests/Sabre/DAV/Xml/Element/ResponseTest.php +++ b/tests/Sabre/DAV/Xml/Element/ResponseTest.php @@ -189,7 +189,7 @@ public function testDeserializeComplexProperty() '; $result = $this->parse($xml, [ - '{DAV:}response' => 'Sabre\DAV\Xml\Element\Response', + '{DAV:}response' => \Sabre\DAV\Xml\Element\Response::class, '{DAV:}foo' => function ($reader) { $reader->next(); @@ -346,7 +346,7 @@ public function testDeserializeComplexPropertyEmpty() '; $result = $this->parse($xml, [ - '{DAV:}response' => 'Sabre\DAV\Xml\Element\Response', + '{DAV:}response' => \Sabre\DAV\Xml\Element\Response::class, '{DAV:}foo' => function ($reader) { throw new \LogicException('This should never happen'); }, diff --git a/tests/Sabre/DAV/Xml/Element/ShareeTest.php b/tests/Sabre/DAV/Xml/Element/ShareeTest.php index ff1ba307ef..574a5b069c 100644 --- a/tests/Sabre/DAV/Xml/Element/ShareeTest.php +++ b/tests/Sabre/DAV/Xml/Element/ShareeTest.php @@ -32,7 +32,7 @@ public function testDeserialize() XML; $result = $this->parse($xml, [ - '{DAV:}sharee' => 'Sabre\\DAV\\Xml\\Element\\Sharee', + '{DAV:}sharee' => \Sabre\DAV\Xml\Element\Sharee::class, ]); $expected = new Sharee([ @@ -49,7 +49,7 @@ public function testDeserialize() public function testDeserializeNoHref() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -64,13 +64,13 @@ public function testDeserializeNoHref() XML; $this->parse($xml, [ - '{DAV:}sharee' => 'Sabre\\DAV\\Xml\\Element\\Sharee', + '{DAV:}sharee' => \Sabre\DAV\Xml\Element\Sharee::class, ]); } public function testDeserializeNoShareeAccess() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = << @@ -83,7 +83,7 @@ public function testDeserializeNoShareeAccess() XML; $this->parse($xml, [ - '{DAV:}sharee' => 'Sabre\\DAV\\Xml\\Element\\Sharee', + '{DAV:}sharee' => \Sabre\DAV\Xml\Element\Sharee::class, ]); } } diff --git a/tests/Sabre/DAV/Xml/Property/HrefTest.php b/tests/Sabre/DAV/Xml/Property/HrefTest.php index dcc564b26b..f0cc32c205 100644 --- a/tests/Sabre/DAV/Xml/Property/HrefTest.php +++ b/tests/Sabre/DAV/Xml/Property/HrefTest.php @@ -36,11 +36,11 @@ public function testUnserialize() /bla/path '; - $result = $this->parse($xml, ['{DAV:}anything' => 'Sabre\\DAV\\Xml\\Property\\Href']); + $result = $this->parse($xml, ['{DAV:}anything' => \Sabre\DAV\Xml\Property\Href::class]); $href = $result['value']; - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $href); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $href); self::assertEquals('/bla/path', $href->getHref()); } @@ -50,7 +50,7 @@ public function testUnserializeIncompatible() $xml = ' /bla/path '; - $result = $this->parse($xml, ['{DAV:}anything' => 'Sabre\\DAV\\Xml\\Property\\Href']); + $result = $this->parse($xml, ['{DAV:}anything' => \Sabre\DAV\Xml\Property\Href::class]); $href = $result['value']; self::assertNull($href); } @@ -60,7 +60,7 @@ public function testUnserializeEmpty() $xml = ' '; - $result = $this->parse($xml, ['{DAV:}anything' => 'Sabre\\DAV\\Xml\\Property\\Href']); + $result = $this->parse($xml, ['{DAV:}anything' => \Sabre\DAV\Xml\Property\Href::class]); $href = $result['value']; self::assertNull($href); } diff --git a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php index ffce1366ce..29fddc5bfb 100644 --- a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php +++ b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php @@ -46,7 +46,7 @@ public function testDeserialize() Tue, 24 Mar 2015 18:47:00 GMT XML; - $elementMap = ['{DAV:}getlastmodified' => 'Sabre\DAV\Xml\Property\GetLastModified']; + $elementMap = ['{DAV:}getlastmodified' => \Sabre\DAV\Xml\Property\GetLastModified::class]; $result = $this->parse($input, $elementMap); self::assertEquals( diff --git a/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php b/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php index 1959bb12b5..63a37c4936 100644 --- a/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php +++ b/tests/Sabre/DAV/Xml/Property/ShareAccessTest.php @@ -100,7 +100,7 @@ public function testDeserialize() public function testDeserializeInvalid() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $input = << diff --git a/tests/Sabre/DAV/Xml/Request/PropFindTest.php b/tests/Sabre/DAV/Xml/Request/PropFindTest.php index bad1d0b198..750ab6b334 100644 --- a/tests/Sabre/DAV/Xml/Request/PropFindTest.php +++ b/tests/Sabre/DAV/Xml/Request/PropFindTest.php @@ -18,7 +18,7 @@ public function testDeserializeProp() '; - $result = $this->parse($xml, ['{DAV:}root' => 'Sabre\\DAV\\Xml\\Request\PropFind']); + $result = $this->parse($xml, ['{DAV:}root' => \Sabre\DAV\Xml\Request\PropFind::class]); $propFind = new PropFind(); $propFind->properties = ['{DAV:}hello']; @@ -34,7 +34,7 @@ public function testDeserializeAllProp() '; - $result = $this->parse($xml, ['{DAV:}root' => 'Sabre\\DAV\\Xml\\Request\PropFind']); + $result = $this->parse($xml, ['{DAV:}root' => \Sabre\DAV\Xml\Request\PropFind::class]); $propFind = new PropFind(); $propFind->allProp = true; diff --git a/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php b/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php index aac66c9aac..7a0d8c57eb 100644 --- a/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php +++ b/tests/Sabre/DAV/Xml/Request/ShareResourceTest.php @@ -41,11 +41,11 @@ public function testDeserialize() XML; $result = $this->parse($xml, [ - '{DAV:}share-resource' => 'Sabre\\DAV\\Xml\\Request\\ShareResource', + '{DAV:}share-resource' => \Sabre\DAV\Xml\Request\ShareResource::class, ]); self::assertInstanceOf( - 'Sabre\\DAV\\Xml\\Request\\ShareResource', + \Sabre\DAV\Xml\Request\ShareResource::class, $result['value'] ); diff --git a/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php b/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php index 8cb811c4f2..4f25696be0 100644 --- a/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php +++ b/tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php @@ -20,7 +20,7 @@ public function testDeserializeProp() '; - $result = $this->parse($xml, ['{DAV:}sync-collection' => 'Sabre\\DAV\\Xml\\Request\\SyncCollectionReport']); + $result = $this->parse($xml, ['{DAV:}sync-collection' => \Sabre\DAV\Xml\Request\SyncCollectionReport::class]); $elem = new SyncCollectionReport(); $elem->syncLevel = 1; @@ -42,7 +42,7 @@ public function testDeserializeLimit() '; - $result = $this->parse($xml, ['{DAV:}sync-collection' => 'Sabre\\DAV\\Xml\\Request\\SyncCollectionReport']); + $result = $this->parse($xml, ['{DAV:}sync-collection' => \Sabre\DAV\Xml\Request\SyncCollectionReport::class]); $elem = new SyncCollectionReport(); $elem->syncLevel = 1; @@ -64,7 +64,7 @@ public function testDeserializeInfinity() '; - $result = $this->parse($xml, ['{DAV:}sync-collection' => 'Sabre\\DAV\\Xml\\Request\\SyncCollectionReport']); + $result = $this->parse($xml, ['{DAV:}sync-collection' => \Sabre\DAV\Xml\Request\SyncCollectionReport::class]); $elem = new SyncCollectionReport(); $elem->syncLevel = \Sabre\DAV\Server::DEPTH_INFINITY; @@ -75,13 +75,13 @@ public function testDeserializeInfinity() public function testDeserializeMissingElem() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = ' '; - $result = $this->parse($xml, ['{DAV:}sync-collection' => 'Sabre\\DAV\\Xml\\Request\\SyncCollectionReport']); + $result = $this->parse($xml, ['{DAV:}sync-collection' => \Sabre\DAV\Xml\Request\SyncCollectionReport::class]); } } diff --git a/tests/Sabre/DAV/Xml/ServiceTest.php b/tests/Sabre/DAV/Xml/ServiceTest.php index a15014e770..7a10da710b 100644 --- a/tests/Sabre/DAV/Xml/ServiceTest.php +++ b/tests/Sabre/DAV/Xml/ServiceTest.php @@ -10,7 +10,7 @@ class ServiceTest extends TestCase { public function testInvalidNameSpace() { - $this->expectException('Sabre\Xml\LibXMLException'); + $this->expectException(\Sabre\Xml\LibXMLException::class); $xml = ''; $util = new Service(); $util->expect('{DAV:}propfind', $xml); diff --git a/tests/Sabre/DAVACL/ACLMethodTest.php b/tests/Sabre/DAVACL/ACLMethodTest.php index 52bf4a86d1..d98f0ad41c 100644 --- a/tests/Sabre/DAVACL/ACLMethodTest.php +++ b/tests/Sabre/DAVACL/ACLMethodTest.php @@ -11,7 +11,7 @@ class ACLMethodTest extends \PHPUnit\Framework\TestCase { public function testCallback() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $acl = new Plugin(); $server = new DAV\Server(); $server->addPlugin(new DAV\Auth\Plugin()); @@ -25,7 +25,7 @@ public function testCallback() */ public function testNotSupportedByNode() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $tree = [ new DAV\SimpleCollection('test'), ]; @@ -64,7 +64,7 @@ public function testSuccessSimple() public function testUnrecognizedPrincipal() { - $this->expectException('Sabre\DAVACL\Exception\NotRecognizedPrincipal'); + $this->expectException(\Sabre\DAVACL\Exception\NotRecognizedPrincipal::class); $tree = [ new MockACLNode('test', []), ]; @@ -87,7 +87,7 @@ public function testUnrecognizedPrincipal() public function testUnrecognizedPrincipal2() { - $this->expectException('Sabre\DAVACL\Exception\NotRecognizedPrincipal'); + $this->expectException(\Sabre\DAVACL\Exception\NotRecognizedPrincipal::class); $tree = [ new MockACLNode('test', []), new DAV\SimpleCollection('principals', [ @@ -113,7 +113,7 @@ public function testUnrecognizedPrincipal2() public function testUnknownPrivilege() { - $this->expectException('Sabre\DAVACL\Exception\NotSupportedPrivilege'); + $this->expectException(\Sabre\DAVACL\Exception\NotSupportedPrivilege::class); $tree = [ new MockACLNode('test', []), ]; @@ -136,7 +136,7 @@ public function testUnknownPrivilege() public function testAbstractPrivilege() { - $this->expectException('Sabre\DAVACL\Exception\NoAbstract'); + $this->expectException(\Sabre\DAVACL\Exception\NoAbstract::class); $tree = [ new MockACLNode('test', []), ]; @@ -162,7 +162,7 @@ public function testAbstractPrivilege() public function testUpdateProtectedPrivilege() { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); + $this->expectException(\Sabre\DAVACL\Exception\AceConflict::class); $oldACL = [ [ 'principal' => 'principals/notfound', @@ -193,7 +193,7 @@ public function testUpdateProtectedPrivilege() public function testUpdateProtectedPrivilege2() { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); + $this->expectException(\Sabre\DAVACL\Exception\AceConflict::class); $oldACL = [ [ 'principal' => 'principals/notfound', @@ -224,7 +224,7 @@ public function testUpdateProtectedPrivilege2() public function testUpdateProtectedPrivilege3() { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); + $this->expectException(\Sabre\DAVACL\Exception\AceConflict::class); $oldACL = [ [ 'principal' => 'principals/notfound', diff --git a/tests/Sabre/DAVACL/BlockAccessTest.php b/tests/Sabre/DAVACL/BlockAccessTest.php index db33b9d318..3b45a6d877 100644 --- a/tests/Sabre/DAVACL/BlockAccessTest.php +++ b/tests/Sabre/DAVACL/BlockAccessTest.php @@ -38,7 +38,7 @@ public function setup(): void public function testGet() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('GET'); $this->server->httpRequest->setUrl('/testdir'); @@ -56,7 +56,7 @@ public function testGetDoesntExist() public function testHEAD() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('HEAD'); $this->server->httpRequest->setUrl('/testdir'); @@ -65,7 +65,7 @@ public function testHEAD() public function testOPTIONS() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('OPTIONS'); $this->server->httpRequest->setUrl('/testdir'); @@ -74,7 +74,7 @@ public function testOPTIONS() public function testPUT() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('PUT'); $this->server->httpRequest->setUrl('/testdir'); @@ -83,7 +83,7 @@ public function testPUT() public function testPROPPATCH() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('PROPPATCH'); $this->server->httpRequest->setUrl('/testdir'); @@ -92,7 +92,7 @@ public function testPROPPATCH() public function testCOPY() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('COPY'); $this->server->httpRequest->setUrl('/testdir'); @@ -101,7 +101,7 @@ public function testCOPY() public function testMOVE() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('MOVE'); $this->server->httpRequest->setUrl('/testdir'); @@ -110,7 +110,7 @@ public function testMOVE() public function testACL() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('ACL'); $this->server->httpRequest->setUrl('/testdir'); @@ -119,7 +119,7 @@ public function testACL() public function testLOCK() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->httpRequest->setMethod('LOCK'); $this->server->httpRequest->setUrl('/testdir'); @@ -128,13 +128,13 @@ public function testLOCK() public function testBeforeBind() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->emit('beforeBind', ['testdir/file']); } public function testBeforeUnbind() { - $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges'); + $this->expectException(\Sabre\DAVACL\Exception\NeedPrivileges::class); $this->server->emit('beforeUnbind', ['testdir']); } diff --git a/tests/Sabre/DAVACL/FS/CollectionTest.php b/tests/Sabre/DAVACL/FS/CollectionTest.php index 989fc21981..a9e18852e1 100644 --- a/tests/Sabre/DAVACL/FS/CollectionTest.php +++ b/tests/Sabre/DAVACL/FS/CollectionTest.php @@ -24,7 +24,7 @@ public function testGetChildFile() { file_put_contents(TestUtil::SABRE_TEMPDIR.'/file.txt', 'hello'); $child = $this->sut->getChild('file.txt'); - self::assertInstanceOf('Sabre\\DAVACL\\FS\\File', $child); + self::assertInstanceOf(\Sabre\DAVACL\FS\File::class, $child); self::assertEquals('file.txt', $child->getName()); self::assertEquals($this->acl, $child->getACL()); @@ -35,7 +35,7 @@ public function testGetChildDirectory() { mkdir(TestUtil::SABRE_TEMPDIR.'/dir'); $child = $this->sut->getChild('dir'); - self::assertInstanceOf('Sabre\\DAVACL\\FS\\Collection', $child); + self::assertInstanceOf(\Sabre\DAVACL\FS\Collection::class, $child); self::assertEquals('dir', $child->getName()); self::assertEquals($this->acl, $child->getACL()); diff --git a/tests/Sabre/DAVACL/FS/FileTest.php b/tests/Sabre/DAVACL/FS/FileTest.php index 2dfdf9c1d6..3cafe01daf 100644 --- a/tests/Sabre/DAVACL/FS/FileTest.php +++ b/tests/Sabre/DAVACL/FS/FileTest.php @@ -53,7 +53,7 @@ public function testGetACL() public function testSetAcl() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->sut->setACL([]); } diff --git a/tests/Sabre/DAVACL/FS/HomeCollectionTest.php b/tests/Sabre/DAVACL/FS/HomeCollectionTest.php index 69f65ba90d..af6a2c1ef5 100644 --- a/tests/Sabre/DAVACL/FS/HomeCollectionTest.php +++ b/tests/Sabre/DAVACL/FS/HomeCollectionTest.php @@ -44,7 +44,7 @@ public function testGetName() public function testGetChild() { $child = $this->sut->getChild('user1'); - self::assertInstanceOf('Sabre\\DAVACL\\FS\\Collection', $child); + self::assertInstanceOf(\Sabre\DAVACL\FS\Collection::class, $child); self::assertEquals('user1', $child->getName()); $owner = 'principals/user1'; @@ -92,7 +92,7 @@ public function testGetACL() public function testSetAcl() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->sut->setACL([]); } diff --git a/tests/Sabre/DAVACL/PluginPropertiesTest.php b/tests/Sabre/DAVACL/PluginPropertiesTest.php index dca67974eb..cfd0f77ada 100644 --- a/tests/Sabre/DAVACL/PluginPropertiesTest.php +++ b/tests/Sabre/DAVACL/PluginPropertiesTest.php @@ -37,7 +37,7 @@ public function testPrincipalCollectionSet() self::assertEquals(1, count($result[200])); self::assertArrayHasKey('{DAV:}principal-collection-set', $result[200]); - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $result[200]['{DAV:}principal-collection-set']); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $result[200]['{DAV:}principal-collection-set']); $expected = [ 'principals1/', @@ -70,7 +70,7 @@ public function testCurrentUserPrincipal() self::assertEquals(1, count($result[200])); self::assertArrayHasKey('{DAV:}current-user-principal', $result[200]); - self::assertInstanceOf('Sabre\DAVACL\Xml\Property\Principal', $result[200]['{DAV:}current-user-principal']); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\Principal::class, $result[200]['{DAV:}current-user-principal']); self::assertEquals(Xml\Property\Principal::UNAUTHENTICATED, $result[200]['{DAV:}current-user-principal']->getType()); // This will force the login @@ -81,7 +81,7 @@ public function testCurrentUserPrincipal() self::assertEquals(1, count($result[200])); self::assertArrayHasKey('{DAV:}current-user-principal', $result[200]); - self::assertInstanceOf('Sabre\DAVACL\Xml\Property\Principal', $result[200]['{DAV:}current-user-principal']); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\Principal::class, $result[200]['{DAV:}current-user-principal']); self::assertEquals(Xml\Property\Principal::HREF, $result[200]['{DAV:}current-user-principal']->getType()); self::assertEquals('principals/admin/', $result[200]['{DAV:}current-user-principal']->getHref()); } @@ -108,7 +108,7 @@ public function testSupportedPrivilegeSet() self::assertEquals(1, count($result[200])); self::assertArrayHasKey('{DAV:}supported-privilege-set', $result[200]); - self::assertInstanceOf('Sabre\\DAVACL\\Xml\\Property\\SupportedPrivilegeSet', $result[200]['{DAV:}supported-privilege-set']); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\SupportedPrivilegeSet::class, $result[200]['{DAV:}supported-privilege-set']); $server = new DAV\Server(); @@ -188,7 +188,7 @@ public function testACL() self::assertEquals(1, count($result[200]), 'The {DAV:}acl property did not return from the list. Full list: '.print_r($result, true)); self::assertArrayHasKey('{DAV:}acl', $result[200]); - self::assertInstanceOf('Sabre\\DAVACL\\Xml\Property\\Acl', $result[200]['{DAV:}acl']); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\Acl::class, $result[200]['{DAV:}acl']); } public function testACLRestrictions() @@ -225,7 +225,7 @@ public function testACLRestrictions() self::assertEquals(1, count($result[200]), 'The {DAV:}acl-restrictions property did not return from the list. Full list: '.print_r($result, true)); self::assertArrayHasKey('{DAV:}acl-restrictions', $result[200]); - self::assertInstanceOf('Sabre\\DAVACL\\Xml\\Property\\AclRestrictions', $result[200]['{DAV:}acl-restrictions']); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\AclRestrictions::class, $result[200]['{DAV:}acl-restrictions']); } public function testAlternateUriSet() @@ -257,7 +257,7 @@ public function testAlternateUriSet() self::assertTrue(isset($result[200])); self::assertTrue(isset($result[200]['{DAV:}alternate-URI-set'])); - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $result[200]['{DAV:}alternate-URI-set']); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $result[200]['{DAV:}alternate-URI-set']); self::assertEquals([], $result[200]['{DAV:}alternate-URI-set']->getHrefs()); } @@ -292,7 +292,7 @@ public function testPrincipalURL() self::assertTrue(isset($result[200])); self::assertTrue(isset($result[200]['{DAV:}principal-URL'])); - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $result[200]['{DAV:}principal-URL']); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $result[200]['{DAV:}principal-URL']); self::assertEquals('principals/user/', $result[200]['{DAV:}principal-URL']->getHref()); } @@ -327,7 +327,7 @@ public function testGroupMemberSet() self::assertTrue(isset($result[200])); self::assertTrue(isset($result[200]['{DAV:}group-member-set'])); - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $result[200]['{DAV:}group-member-set']); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $result[200]['{DAV:}group-member-set']); self::assertEquals([], $result[200]['{DAV:}group-member-set']->getHrefs()); } @@ -360,7 +360,7 @@ public function testGroupMemberShip() self::assertTrue(isset($result[200])); self::assertTrue(isset($result[200]['{DAV:}group-membership'])); - self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $result[200]['{DAV:}group-membership']); + self::assertInstanceOf(\Sabre\DAV\Xml\Property\Href::class, $result[200]['{DAV:}group-membership']); self::assertEquals([], $result[200]['{DAV:}group-membership']->getHrefs()); } diff --git a/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php b/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php index c6615ab67f..eb1a98b6e8 100644 --- a/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php +++ b/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php @@ -74,7 +74,7 @@ public function testSetGroupMembers() public function testSetBadValue() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $tree = [ new MockPrincipal('foo', 'foo'), ]; diff --git a/tests/Sabre/DAVACL/PrincipalCollectionTest.php b/tests/Sabre/DAVACL/PrincipalCollectionTest.php index 47614d62e3..527e3b47f0 100644 --- a/tests/Sabre/DAVACL/PrincipalCollectionTest.php +++ b/tests/Sabre/DAVACL/PrincipalCollectionTest.php @@ -36,7 +36,7 @@ public function testGetChildren() */ public function testGetChildrenDisable() { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); + $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $backend = new PrincipalBackend\Mock(); $pc = new PrincipalCollection($backend); $pc->disableListing = true; diff --git a/tests/Sabre/DAVACL/PrincipalTest.php b/tests/Sabre/DAVACL/PrincipalTest.php index 0ed68fd196..26dacae946 100644 --- a/tests/Sabre/DAVACL/PrincipalTest.php +++ b/tests/Sabre/DAVACL/PrincipalTest.php @@ -17,7 +17,7 @@ public function testConstruct() public function testConstructNoUri() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $principalBackend = new PrincipalBackend\Mock(); $principal = new Principal($principalBackend, []); } @@ -177,7 +177,7 @@ public function testGetACl() public function testSetACl() { - $this->expectException('Sabre\DAV\Exception\Forbidden'); + $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $principalBackend = new PrincipalBackend\Mock(); $principal = new Principal($principalBackend, ['uri' => 'principals/admin']); $principal->setACL([]); diff --git a/tests/Sabre/DAVACL/Xml/Property/ACLTest.php b/tests/Sabre/DAVACL/Xml/Property/ACLTest.php index 5ba4816346..6cc2ca422a 100644 --- a/tests/Sabre/DAVACL/Xml/Property/ACLTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/ACLTest.php @@ -12,7 +12,7 @@ class ACLTest extends \PHPUnit\Framework\TestCase public function testConstruct() { $acl = new Acl([]); - self::assertInstanceOf('Sabre\DAVACL\Xml\Property\ACL', $acl); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\ACL::class, $acl); } public function testSerializeEmpty() @@ -157,13 +157,13 @@ public function testUnserialize() '; $reader = new \Sabre\Xml\Reader(); - $reader->elementMap['{DAV:}root'] = 'Sabre\DAVACL\Xml\Property\Acl'; + $reader->elementMap['{DAV:}root'] = \Sabre\DAVACL\Xml\Property\Acl::class; $reader->xml($source); $result = $reader->parse(); $result = $result['value']; - self::assertInstanceOf('Sabre\\DAVACL\\Xml\\Property\\Acl', $result); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\Acl::class, $result); $expected = [ [ @@ -183,7 +183,7 @@ public function testUnserialize() public function testUnserializeNoPrincipal() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $source = ' @@ -197,7 +197,7 @@ public function testUnserializeNoPrincipal() '; $reader = new \Sabre\Xml\Reader(); - $reader->elementMap['{DAV:}root'] = 'Sabre\DAVACL\Xml\Property\Acl'; + $reader->elementMap['{DAV:}root'] = \Sabre\DAVACL\Xml\Property\Acl::class; $reader->xml($source); $result = $reader->parse(); @@ -236,13 +236,13 @@ public function testUnserializeOtherPrincipal() '; $reader = new \Sabre\Xml\Reader(); - $reader->elementMap['{DAV:}root'] = 'Sabre\DAVACL\Xml\Property\Acl'; + $reader->elementMap['{DAV:}root'] = \Sabre\DAVACL\Xml\Property\Acl::class; $reader->xml($source); $result = $reader->parse(); $result = $result['value']; - self::assertInstanceOf('Sabre\\DAVACL\\Xml\\Property\\Acl', $result); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\Acl::class, $result); $expected = [ [ @@ -267,7 +267,7 @@ public function testUnserializeOtherPrincipal() public function testUnserializeDeny() { - $this->expectException('Sabre\DAV\Exception\NotImplemented'); + $this->expectException(\Sabre\DAV\Exception\NotImplemented::class); $source = ' @@ -283,7 +283,7 @@ public function testUnserializeDeny() '; $reader = new \Sabre\Xml\Reader(); - $reader->elementMap['{DAV:}root'] = 'Sabre\DAVACL\Xml\Property\Acl'; + $reader->elementMap['{DAV:}root'] = \Sabre\DAVACL\Xml\Property\Acl::class; $reader->xml($source); $result = $reader->parse(); diff --git a/tests/Sabre/DAVACL/Xml/Property/AclRestrictionsTest.php b/tests/Sabre/DAVACL/Xml/Property/AclRestrictionsTest.php index 6ae3b69ee3..2be0fd909d 100644 --- a/tests/Sabre/DAVACL/Xml/Property/AclRestrictionsTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/AclRestrictionsTest.php @@ -11,7 +11,7 @@ class AclRestrictionsTest extends \PHPUnit\Framework\TestCase public function testConstruct() { $prop = new AclRestrictions(); - self::assertInstanceOf('Sabre\DAVACL\Xml\Property\AclRestrictions', $prop); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\AclRestrictions::class, $prop); } public function testSerialize() diff --git a/tests/Sabre/DAVACL/Xml/Property/CurrentUserPrivilegeSetTest.php b/tests/Sabre/DAVACL/Xml/Property/CurrentUserPrivilegeSetTest.php index b4fb191789..44d6cf8153 100644 --- a/tests/Sabre/DAVACL/Xml/Property/CurrentUserPrivilegeSetTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/CurrentUserPrivilegeSetTest.php @@ -56,7 +56,7 @@ public function testUnserialize() public function parse($xml) { $reader = new Reader(); - $reader->elementMap['{DAV:}root'] = 'Sabre\\DAVACL\\Xml\\Property\\CurrentUserPrivilegeSet'; + $reader->elementMap['{DAV:}root'] = \Sabre\DAVACL\Xml\Property\CurrentUserPrivilegeSet::class; $reader->xml($xml); $result = $reader->parse(); diff --git a/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php b/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php index e437204390..59f14bdc46 100644 --- a/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php @@ -30,7 +30,7 @@ public function testSimple() */ public function testNoHref() { - $this->expectException('Sabre\DAV\Exception'); + $this->expectException(\Sabre\DAV\Exception::class); $principal = new Principal(Principal::HREF); } @@ -113,7 +113,7 @@ public function testUnserializeUnauthenticated() public function testUnserializeUnknown() { - $this->expectException('Sabre\DAV\Exception\BadRequest'); + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $xml = ' '. ' '. @@ -125,7 +125,7 @@ public function testUnserializeUnknown() public function parse($xml) { $reader = new Reader(); - $reader->elementMap['{DAV:}principal'] = 'Sabre\\DAVACL\\Xml\\Property\\Principal'; + $reader->elementMap['{DAV:}principal'] = \Sabre\DAVACL\Xml\Property\Principal::class; $reader->xml($xml); $result = $reader->parse(); diff --git a/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php b/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php index 5bde649b18..566caac2b3 100644 --- a/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php @@ -14,7 +14,7 @@ public function testSimple() $prop = new SupportedPrivilegeSet([ 'privilege' => '{DAV:}all', ]); - self::assertInstanceOf('Sabre\DAVACL\Xml\Property\SupportedPrivilegeSet', $prop); + self::assertInstanceOf(\Sabre\DAVACL\Xml\Property\SupportedPrivilegeSet::class, $prop); } /** diff --git a/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php b/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php index 4909792fcf..de21170b79 100644 --- a/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php +++ b/tests/Sabre/DAVACL/Xml/Request/AclPrincipalPropSetReportTest.php @@ -7,7 +7,7 @@ class AclPrincipalPropSetReportTest extends \Sabre\DAV\Xml\AbstractXmlTestCase { protected $elementMap = [ - '{DAV:}acl-principal-prop-set' => 'Sabre\DAVACL\Xml\Request\AclPrincipalPropSetReport', + '{DAV:}acl-principal-prop-set' => \Sabre\DAVACL\Xml\Request\AclPrincipalPropSetReport::class, ]; public function testDeserialize() diff --git a/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php b/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php index bc890f8d41..64eff1075a 100644 --- a/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php +++ b/tests/Sabre/DAVACL/Xml/Request/PrincipalMatchReportTest.php @@ -9,7 +9,7 @@ class PrincipalMatchReportTest extends AbstractXmlTestCase { protected $elementMap = [ - '{DAV:}principal-match' => 'Sabre\DAVACL\Xml\Request\PrincipalMatchReport', + '{DAV:}principal-match' => \Sabre\DAVACL\Xml\Request\PrincipalMatchReport::class, ]; public function testDeserialize()