Skip to content

Commit

Permalink
Merge pull request #489 from owncloud/coding-standard-2.0.0
Browse files Browse the repository at this point in the history
Coding standard 2.0.0
  • Loading branch information
individual-it authored Dec 17, 2019
2 parents 87c74d2 + 605908e commit 8e30d32
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .drone.starlark
Original file line number Diff line number Diff line change
Expand Up @@ -2315,7 +2315,7 @@ def setupCeph(serviceParams):

createFirstBucket = serviceParams['createFirstBucket'] if 'createFirstBucket' in serviceParams else True
setupCommands = serviceParams['setupCommands'] if 'setupCommands' in serviceParams else [
'wait-for-it -t 120 ceph:80',
'wait-for-it -t 600 ceph:80',
'cd /var/www/owncloud/server/apps/files_primary_s3',
'cp tests/drone/ceph.config.php /var/www/owncloud/server/config',
'cd /var/www/owncloud/server',
Expand Down Expand Up @@ -2343,7 +2343,7 @@ def setupScality(serviceParams):
createFirstBucket = serviceParams['createFirstBucket'] if 'createFirstBucket' in serviceParams else True
createExtraBuckets = serviceParams['createExtraBuckets'] if 'createExtraBuckets' in serviceParams else False
setupCommands = serviceParams['setupCommands'] if 'setupCommands' in serviceParams else [
'wait-for-it -t 120 scality:8000',
'wait-for-it -t 600 scality:8000',
'cd /var/www/owncloud/server/apps/files_primary_s3',
'cp tests/drone/%s /var/www/owncloud/server/config' % configFile,
'cd /var/www/owncloud/server'
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ public function testUseBackupServer() {
}

/**
* @expectedException \OC\ServerNotAvailableException
*/
public function testConnectFails() {
$this->expectException(\OC\ServerNotAvailableException::class);

$mainHost = 'ldap://nixda.ldap';
$config = [
'ldapConfigurationActive' => true,
Expand Down Expand Up @@ -203,9 +204,10 @@ public function testBind() {
}

/**
* @expectedException \OCA\User_LDAP\Exceptions\BindFailedException
*/
public function testBindFails() {
$this->expectException(\OCA\User_LDAP\Exceptions\BindFailedException::class);

$mainHost = 'ldap://nixda.ldap';
$config = [
'ldapConfigurationActive' => true,
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/User/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ public function testGetUserEntryByDn() {
}

/**
* @expectedException \OutOfBoundsException
*/
public function testGetUserEntryByDnNotPartOfBase() {
$this->expectException(\OutOfBoundsException::class);

$this->access->expects($this->once())
->method('executeRead')
->will($this->returnValue([
Expand All @@ -369,9 +370,10 @@ public function testGetUserEntryByDnNotPartOfBase() {
}

/**
* @expectedException \OCA\User_LDAP\Exceptions\DoesNotExistOnLDAPException
*/
public function testGetUserEntryByDnNotFound() {
$this->expectException(\OCA\User_LDAP\Exceptions\DoesNotExistOnLDAPException::class);

$this->access->expects($this->once())
->method('executeRead')
->will($this->returnValue([
Expand All @@ -382,9 +384,10 @@ public function testGetUserEntryByDnNotFound() {

/**
* FIXME the ldap error should bubble up ... and not be converted to a DoesNotExistOnLDAPException
* @expectedException \OCA\User_LDAP\Exceptions\DoesNotExistOnLDAPException
*/
public function testGetUserEntryByDnLDAPError() {
$this->expectException(\OCA\User_LDAP\Exceptions\DoesNotExistOnLDAPException::class);

$this->access->expects($this->once())
->method('executeRead')
->will($this->returnValue(false));
Expand Down
15 changes: 10 additions & 5 deletions tests/unit/User/UserEntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ protected function setUp(): void {
}

/**
* @expectedException \InvalidArgumentException
*/
public function testInvalidNew() {
$this->expectException(\InvalidArgumentException::class);

new UserEntry($this->config, $this->logger, $this->connection, []);
}

Expand Down Expand Up @@ -120,9 +121,10 @@ public function testGetUserIdFallbackOnUUID($uuidAttr, $uuidValue, $expected) {
}

/**
* @expectedException \OutOfBoundsException
*/
public function testGetUserIdUndetermined() {
$this->expectException(\OutOfBoundsException::class);

$this->connection->expects($this->exactly(1))
->method('__get')
->with($this->equalTo('ldapExpertUsernameAttr'))
Expand Down Expand Up @@ -199,9 +201,10 @@ public function testGetUUIDIsAuto($uuidAttr, $uuidValue, $expected) {
}

/**
* @expectedException \OutOfBoundsException
*/
public function testGetUUIDUndetermined() {
$this->expectException(\OutOfBoundsException::class);

$this->connection->expects($this->once())
->method('__get')
->with($this->equalTo('ldapExpertUUIDUserAttr'))
Expand All @@ -215,9 +218,10 @@ public function testGetUUIDUndetermined() {
}

/**
* @expectedException \OutOfBoundsException
*/
public function testGetUUIDInvalidBinaryUUID() {
$this->expectException(\OutOfBoundsException::class);

$this->connection->expects($this->exactly(2))
->method('__get')
->with($this->equalTo('ldapExpertUUIDUserAttr'))
Expand Down Expand Up @@ -464,9 +468,10 @@ public function testGetHomeUnset() {
}

/**
* @expectedException \Exception
*/
public function testGetHomeUnsetButRequired() {
$this->expectException(\Exception::class);

$this->config->expects($this->once())
->method('getAppValue')
->will($this->returnValue(true));
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/owncloud-codestyle/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"owncloud/coding-standard": "^1.0"
"owncloud/coding-standard": "^2.0"
}
}

0 comments on commit 8e30d32

Please sign in to comment.