Merge pull request #5791 from nextcloud/add-php7.2-tests
[CI] Add PHP 7.2 testing container
This commit is contained in:
commit
3b955a1625
22
.drone.yml
22
.drone.yml
|
@ -171,6 +171,14 @@ pipeline:
|
|||
matrix:
|
||||
DB: NODB
|
||||
PHP: 7.1
|
||||
nodb-php7.2:
|
||||
image: nextcloudci/php7.2:php7.2-4
|
||||
commands:
|
||||
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
|
||||
when:
|
||||
matrix:
|
||||
DB: NODB
|
||||
PHP: 7.2
|
||||
sqlite-php5.6:
|
||||
image: nextcloudci/php5.6:php5.6-7
|
||||
commands:
|
||||
|
@ -195,6 +203,14 @@ pipeline:
|
|||
matrix:
|
||||
DB: sqlite
|
||||
PHP: 7.1
|
||||
sqlite-php7.2:
|
||||
image: nextcloudci/php7.2:php7.2-4
|
||||
commands:
|
||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
|
||||
when:
|
||||
matrix:
|
||||
DB: sqlite
|
||||
PHP: 7.2
|
||||
mysql-php5.6:
|
||||
image: nextcloudci/php5.6:php5.6-7
|
||||
commands:
|
||||
|
@ -599,6 +615,9 @@ matrix:
|
|||
- DB: NODB
|
||||
PHP: 7.1
|
||||
ENABLE_REDIS: true
|
||||
- DB: NODB
|
||||
PHP: 7.2
|
||||
ENABLE_REDIS: false
|
||||
- DB: sqlite
|
||||
PHP: 5.6
|
||||
ENABLE_REDIS: true
|
||||
|
@ -608,6 +627,9 @@ matrix:
|
|||
- DB: sqlite
|
||||
PHP: 7.1
|
||||
ENABLE_REDIS: true
|
||||
- DB: sqlite
|
||||
PHP: 7.2
|
||||
ENABLE_REDIS: false
|
||||
- DB: mysql
|
||||
PHP: 5.6
|
||||
ENABLE_REDIS: true
|
||||
|
|
|
@ -243,7 +243,7 @@ class CacheTest extends TestCase {
|
|||
$id2 = $this->sharedCache->get('subdir/another too.txt')['fileid'];
|
||||
$id3 = $this->sharedCache->get('subdir/not a text file.xml')['fileid'];
|
||||
$id4 = $this->sharedCache->get('subdir/another.txt')['fileid'];
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', null, null, $userId);
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', [], false, $userId);
|
||||
$tagManager->tagAs($id1, 'tag1');
|
||||
$tagManager->tagAs($id1, 'tag2');
|
||||
$tagManager->tagAs($id2, 'tag1');
|
||||
|
@ -285,7 +285,7 @@ class CacheTest extends TestCase {
|
|||
$this->sharedCache->get('subdir/emptydir')['fileid'],
|
||||
$this->sharedCache->get('subdir/emptydir2')['fileid'],
|
||||
);
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', null, null, $userId);
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', [], false, $userId);
|
||||
foreach ($allIds as $id) {
|
||||
$tagManager->tagAs($id, 'tag1');
|
||||
}
|
||||
|
|
|
@ -1269,6 +1269,7 @@ class UserTest extends \Test\TestCase {
|
|||
return array(
|
||||
array(
|
||||
'pwdchangedtime' => array((new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'),
|
||||
'pwdgraceusetime' => [],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1342,6 +1343,7 @@ class UserTest extends \Test\TestCase {
|
|||
array(
|
||||
'pwdpolicysubentry' => array('cn=custom,ou=policies,dc=foo,dc=bar'),
|
||||
'pwdchangedtime' => array((new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'),
|
||||
'pwdgraceusetime' => [],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -135,6 +135,9 @@ class User_LDAPTest extends TestCase {
|
|||
return false;
|
||||
}
|
||||
}));
|
||||
|
||||
$access->method('fetchUsersByLoginName')
|
||||
->willReturn([]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -353,6 +356,9 @@ class User_LDAPTest extends TestCase {
|
|||
$access->expects($this->any())
|
||||
->method('nextcloudUserNames')
|
||||
->will($this->returnArgument(0));
|
||||
|
||||
$access->method('fetchUsersByLoginName')
|
||||
->willReturn([]);
|
||||
}
|
||||
|
||||
public function testGetUsersNoParam() {
|
||||
|
@ -760,6 +766,9 @@ class User_LDAPTest extends TestCase {
|
|||
$access->expects($this->any())
|
||||
->method('getUserMapper')
|
||||
->will($this->returnValue($userMapper));
|
||||
|
||||
$access->method('fetchUsersByLoginName')
|
||||
->willReturn([]);
|
||||
}
|
||||
|
||||
public function testGetDisplayName() {
|
||||
|
|
|
@ -432,7 +432,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
// 'application/json' must be decoded manually.
|
||||
if (strpos($this->getHeader('Content-Type'), 'application/json') !== false) {
|
||||
$params = json_decode(file_get_contents($this->inputStream), true);
|
||||
if(count($params) > 0) {
|
||||
if($params !== null && count($params) > 0) {
|
||||
$this->items['params'] = $params;
|
||||
if($this->method === 'POST') {
|
||||
$this->items['post'] = $params;
|
||||
|
|
|
@ -184,7 +184,7 @@ class FailedStorage extends Common {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ class NullStorage extends Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ class Mailer implements IMailer {
|
|||
}
|
||||
|
||||
list($name, $domain) = explode('@', $email, 2);
|
||||
$domain = idn_to_ascii($domain);
|
||||
$domain = idn_to_ascii($domain, 0,INTL_IDNA_VARIANT_UTS46);
|
||||
return $name.'@'.$domain;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,11 +58,11 @@ class Message {
|
|||
foreach($addresses as $email => $readableName) {
|
||||
if(!is_numeric($email)) {
|
||||
list($name, $domain) = explode('@', $email, 2);
|
||||
$domain = idn_to_ascii($domain);
|
||||
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
$convertedAddresses[$name.'@'.$domain] = $readableName;
|
||||
} else {
|
||||
list($name, $domain) = explode('@', $readableName, 2);
|
||||
$domain = idn_to_ascii($domain);
|
||||
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
$convertedAddresses[$email] = $name.'@'.$domain;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,11 +148,12 @@ class Route extends SymfonyRoute implements IRoute {
|
|||
* @return void
|
||||
*/
|
||||
public function actionInclude($file) {
|
||||
$function = create_function('$param',
|
||||
'unset($param["_route"]);'
|
||||
.'$_GET=array_merge($_GET, $param);'
|
||||
.'unset($param);'
|
||||
.'require_once "'.$file.'";');
|
||||
$function = function($param) use ($file) {
|
||||
unset($param["_route"]);
|
||||
$_GET=array_merge($_GET, $param);
|
||||
unset($param);
|
||||
require_once "'.$file.'";
|
||||
} ;
|
||||
$this->action($function);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -291,6 +291,10 @@ class LoginControllerTest extends TestCase {
|
|||
$this->userManager->expects($this->once())
|
||||
->method('checkPasswordNoLogging')
|
||||
->will($this->returnValue(false));
|
||||
$this->userManager->expects($this->once())
|
||||
->method('getByEmail')
|
||||
->with($user)
|
||||
->willReturn([]);
|
||||
$this->urlGenerator->expects($this->once())
|
||||
->method('linkToRoute')
|
||||
->with('core.login.showLoginForm', [
|
||||
|
|
|
@ -261,6 +261,10 @@ class LostControllerTest extends \Test\TestCase {
|
|||
array(false, $nonExistingUser)
|
||||
)));
|
||||
|
||||
$this->userManager
|
||||
->method('getByEmail')
|
||||
->willReturn([]);
|
||||
|
||||
// With a non existing user
|
||||
$response = $this->lostController->email($nonExistingUser);
|
||||
$expectedResponse = new JSONResponse([
|
||||
|
|
|
@ -352,7 +352,7 @@ class CacheTest extends \Test\TestCase {
|
|||
$id4 = $this->cache->put($file4, $fileData['foo2']);
|
||||
$id5 = $this->cache->put($file5, $fileData['foo3']);
|
||||
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', null, null, $userId);
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', [], false, $userId);
|
||||
$this->assertTrue($tagManager->tagAs($id1, 'tag1'));
|
||||
$this->assertTrue($tagManager->tagAs($id1, 'tag2'));
|
||||
$this->assertTrue($tagManager->tagAs($id2, 'tag2'));
|
||||
|
@ -422,7 +422,7 @@ class CacheTest extends \Test\TestCase {
|
|||
$id4 = $this->cache->put($file4, $fileData['foo2']);
|
||||
$id5 = $this->cache->put($file5, $fileData['foo3']);
|
||||
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', null, null, $userId);
|
||||
$tagManager = \OC::$server->getTagManager()->load('files', [], false, $userId);
|
||||
$this->assertTrue($tagManager->tagAs($id1, 'tag1'));
|
||||
$this->assertTrue($tagManager->tagAs($id1, 'tag2'));
|
||||
$this->assertTrue($tagManager->tagAs($id2, 'tag2'));
|
||||
|
|
|
@ -173,8 +173,9 @@ class EncryptionTest extends Storage {
|
|||
->method('get')
|
||||
->willReturnCallback(function($path) {return ['encrypted' => false, 'path' => $path];});
|
||||
|
||||
$this->mountManager = $this->getMockBuilder('\OC\Files\Mount\Manager')
|
||||
->disableOriginalConstructor()->getMock();
|
||||
$this->mountManager = $this->createMock(\OC\Files\Mount\Manager::class);
|
||||
$this->mountManager->method('findByStorageId')
|
||||
->willReturn([]);
|
||||
|
||||
$this->instance = $this->getMockBuilder('\OC\Files\Storage\Wrapper\Encryption')
|
||||
->setConstructorArgs(
|
||||
|
|
|
@ -54,16 +54,22 @@ class RepairMimeTypesTest extends \Test\TestCase {
|
|||
|
||||
protected function tearDown() {
|
||||
$this->storage->getCache()->clear();
|
||||
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
|
||||
\OC_DB::executeAudited($sql, [$this->storage->getId()]);
|
||||
|
||||
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
|
||||
$qb->delete('storages')
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($this->storage->getId())));
|
||||
$qb->execute();
|
||||
|
||||
$this->clearMimeTypes();
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
private function clearMimeTypes() {
|
||||
$sql = 'DELETE FROM `*PREFIX*mimetypes`';
|
||||
\OC_DB::executeAudited($sql);
|
||||
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
|
||||
$qb->delete('mimetypes');
|
||||
$qb->execute();
|
||||
|
||||
$this->mimetypeLoader->reset();
|
||||
}
|
||||
|
||||
|
|
|
@ -434,6 +434,9 @@ class SessionTest extends \Test\TestCase {
|
|||
->method('getSystemValue')
|
||||
->with('token_auth_enforced', false)
|
||||
->will($this->returnValue(false));
|
||||
$manager->method('getByEmail')
|
||||
->with('unexist')
|
||||
->willReturn([]);
|
||||
|
||||
$this->assertFalse($userSession->logClientIn('unexist', 'doe', $request, $this->throttler));
|
||||
}
|
||||
|
@ -1163,6 +1166,10 @@ class SessionTest extends \Test\TestCase {
|
|||
->method('getTime')
|
||||
->will($this->returnValue(100));
|
||||
|
||||
$manager->method('getByEmail')
|
||||
->with('john')
|
||||
->willReturn([]);
|
||||
|
||||
$userSession->logClientIn('john', 'doe', $request, $this->throttler);
|
||||
|
||||
$this->assertEquals(10000, $token->getLastActivity());
|
||||
|
@ -1213,6 +1220,10 @@ class SessionTest extends \Test\TestCase {
|
|||
->method('getTime')
|
||||
->will($this->returnValue(100));
|
||||
|
||||
$manager->method('getByEmail')
|
||||
->with('john')
|
||||
->willReturn([]);
|
||||
|
||||
$userSession->logClientIn('john', 'doe', $request, $this->throttler);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue