aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php46
1 files changed, 21 insertions, 25 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
index d2df483cd..9460b8922 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
@@ -15,7 +15,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
protected $pdo;
- public function setUp()
+ public function setup(): void
{
$this->dropTables([
'calendarobjects',
@@ -67,7 +67,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
];
- $this->assertInternalType('array', $calendars);
+ $this->assertIsArray($calendars);
$this->assertEquals(1, count($calendars));
foreach ($elementCheck as $name => $value) {
@@ -112,7 +112,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
'{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
];
- $this->assertInternalType('array', $calendars);
+ $this->assertIsArray($calendars);
$this->assertEquals(1, count($calendars));
foreach ($elementCheck as $name => $value) {
@@ -123,10 +123,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testConstruct
- * @expectedException \InvalidArgumentException
*/
public function testUpdateCalendarBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
//Creating a new calendar
@@ -186,10 +186,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarAndFetch
- * @expectedException \InvalidArgumentException
*/
public function testDeleteCalendarBadID()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', [
'{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT']),
@@ -201,10 +201,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarAndFetch
- * @expectedException \Sabre\DAV\Exception
*/
public function testCreateCalendarIncorrectComponentSet()
{
+ $this->expectException('Sabre\DAV\Exception');
$backend = new PDO($this->pdo);
//Creating a new calendar
@@ -276,7 +276,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
switch ($key) {
case 'lastmodified':
- $this->assertInternalType('int', $actual);
+ $this->assertIsInt($actual);
break;
case 'calendardata':
if (is_resource($actual)) {
@@ -292,20 +292,20 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetMultipleObjects
- * @expectedException \InvalidArgumentException
*/
public function testGetMultipleObjectsBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getMultipleCalendarObjects('bad-id', ['foo-bar']);
}
/**
- * @expectedException \Sabre\DAV\Exception\BadRequest
* @depends testCreateCalendarObject
*/
public function testCreateCalendarObjectNoComponent()
{
+ $this->expectException('Sabre\DAV\Exception\BadRequest');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -345,10 +345,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testCreateCalendarObject
- * @expectedException \InvalidArgumentException
*/
public function testCreateCalendarObjectBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -519,20 +519,20 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetCalendarObjects
- * @expectedException \InvalidArgumentException
*/
public function testGetCalendarObjectsBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getCalendarObjects('bad-id');
}
/**
* @depends testGetCalendarObjects
- * @expectedException \InvalidArgumentException
*/
public function testGetCalendarObjectBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->getCalendarObject('bad-id', 'foo-bar');
}
@@ -582,10 +582,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testUpdateCalendarObject
- * @expectedException \InvalidArgumentException
*/
public function testUpdateCalendarObjectBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$backend->updateCalendarObject('bad-id', 'object-id', 'objectdata');
}
@@ -608,10 +608,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testDeleteCalendarObject
- * @expectedException \InvalidArgumentException
*/
public function testDeleteCalendarObjectBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
@@ -644,11 +644,11 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
}
/**
- * @expectedException \InvalidArgumentException
* @depends testCalendarQueryNoResult
*/
public function testCalendarQueryBadId()
{
+ $this->expectException('InvalidArgumentException');
$abstract = new PDO($this->pdo);
$filters = [
'name' => 'VCALENDAR',
@@ -859,10 +859,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetChanges
- * @expectedException \InvalidArgumentException
*/
public function testGetChangesBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
$id = $backend->createCalendar(
'principals/user1',
@@ -903,11 +903,9 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
}
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testCreateSubscriptionFail()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$props = [
];
@@ -1109,10 +1107,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testGetInvites
- * @expectedException \InvalidArgumentException
*/
public function testGetInvitesBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
// creating a new calendar
@@ -1259,10 +1257,10 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
/**
* @depends testUpdateInvites
- * @expectedException \InvalidArgumentException
*/
public function testUpdateInvitesBadId()
{
+ $this->expectException('InvalidArgumentException');
$backend = new PDO($this->pdo);
// Add a new invite
$backend->updateInvites(
@@ -1316,7 +1314,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
],
]),
];
- $this->assertEquals($expected, $result, null, 0.0, 10, true); // Last argument is $canonicalize = true, which allows us to compare, ignoring the order, because it's different between MySQL and Sqlite.
+ $this->assertEqualsCanonicalizing($expected, $result);
}
/**
@@ -1390,11 +1388,9 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expected, $result);
}
- /**
- * @expectedException \Sabre\DAV\Exception\NotImplemented
- */
public function testSetPublishStatus()
{
+ $this->expectException('Sabre\DAV\Exception\NotImplemented');
$backend = new PDO($this->pdo);
$backend->setPublishStatus([1, 1], true);
}