Skip to content
Snippets Groups Projects
Verified Commit 8f203510 authored by Damien's avatar Damien
Browse files

FEAT #10118 TIME 0:10 Fix unit tests

parent 3418d5be
No related branches found
No related tags found
No related merge requests found
......@@ -317,12 +317,12 @@ class AttachmentControllerTest extends TestCase
public function testGetAttachmentTypes()
{
$attachmentController = new \Attachment\controllers\AttachmentController();
$attachmentController = new \Attachment\controllers\AttachmentTypeController();
$environment = \Slim\Http\Environment::mock(['REQUEST_METHOD' => 'GET']);
$request = \Slim\Http\Request::createFromEnvironment($environment);
$response = $attachmentController->getAttachmentsTypes($request, new \Slim\Http\Response());
$response = $attachmentController->get($request, new \Slim\Http\Response());
$response = json_decode((string)$response->getBody(), true);
$this->assertNotNull($response['attachmentsTypes']);
......@@ -330,10 +330,10 @@ class AttachmentControllerTest extends TestCase
foreach ($response['attachmentsTypes'] as $value) {
$this->assertNotNull($value['label']);
$this->assertIsBool($value['sign']);
$this->assertIsBool($value['signable']);
$this->assertIsBool($value['chrono']);
$this->assertIsBool($value['attachInMail']);
$this->assertIsBool($value['show']);
$this->assertIsBool($value['emailLink']);
$this->assertIsBool($value['visible']);
}
}
......
......@@ -193,7 +193,7 @@ class StatusControllerTest extends TestCase
$response = $status->delete($request, new \Slim\Http\Response(), ['identifier'=> self::$id]);
$this->assertRegexp('/statuses/', (string)$response->getBody());
$this->assertMatchesRegularExpression('/statuses/', (string)$response->getBody());
}
public function testGetNewInformations()
......
......@@ -23,16 +23,16 @@ class VersionUpdateControllerTest extends TestCase
$this->assertIsString($responseBody->currentVersion);
$this->assertNotNull($responseBody->currentVersion);
$this->assertRegExp('/^\d{2}\.\d{2}\.\d+$/', $responseBody->currentVersion, 'Invalid current version');
$this->assertMatchesRegularExpression('/^\d{2}\.\d{2}\.\d+$/', $responseBody->currentVersion, 'Invalid current version');
if ($responseBody->lastAvailableMinorVersion != null) {
$this->assertIsString($responseBody->lastAvailableMinorVersion);
$this->assertRegExp('/^\d{2}\.\d{2}\.\d+$/', $responseBody->lastAvailableMinorVersion, 'Invalid available minor version');
$this->assertMatchesRegularExpression('/^\d{2}\.\d{2}\.\d+$/', $responseBody->lastAvailableMinorVersion, 'Invalid available minor version');
}
if ($responseBody->lastAvailableMajorVersion != null) {
$this->assertIsString($responseBody->lastAvailableMajorVersion);
$this->assertRegExp('/^\d{2}\.\d{2}\.\d+$/', $responseBody->lastAvailableMajorVersion, 'Invalid available major version');
$this->assertMatchesRegularExpression('/^\d{2}\.\d{2}\.\d+$/', $responseBody->lastAvailableMajorVersion, 'Invalid available major version');
}
}
}
......@@ -71,7 +71,7 @@ class CoreControllerTest extends TestCase
$this->assertStringNotEqualsFile("src/core/lang/lang-{$language}.php", '');
include("src/core/lang/lang-{$language}.php");
$this->assertFileNotExists("src/core/lang/lang-zh.php");
$this->assertFileDoesNotExist("src/core/lang/lang-zh.php");
}
public function testGetExternalConnectionsEnabled()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment