Skip to content

Commit

Permalink
Code checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Aug 25, 2022
1 parent 3052abb commit e8e780a
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 52 deletions.
14 changes: 7 additions & 7 deletions src/symfony/Service/UploadedFileServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ interface UploadedFileServiceInterface {
*/
const SERVICE_NAME = "wbw.core.service.uploaded_file";

/**
* Get the directory.
*
* @return string|null Returns the directory.
*/
public function getDirectory(): ?string;

/**
* Determines if a filename exists.
*
Expand All @@ -44,6 +37,13 @@ public function getDirectory(): ?string;
*/
public function exists(string $filename): bool;

/**
* Get the directory.
*
* @return string|null Returns the directory.
*/
public function getDirectory(): ?string;

/**
* Path.
*
Expand Down
3 changes: 1 addition & 2 deletions tests/core/Model/CpuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@

namespace WBW\Library\Core\Tests\Model;

use JsonSerializable;
use WBW\Library\Core\Model\Cpu;
use WBW\Library\Core\Tests\AbstractTestCase;

use JsonSerializable;

/**
* CPU test.
*
Expand Down
16 changes: 8 additions & 8 deletions tests/core/Model/CpuTest.testJsonSerialize.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"us":0.123456789,
"sy":0.234567891,
"ni":0.345678912,
"id":0.456789123,
"wa":0.567891234,
"hi":0.678912345,
"si":0.789123456,
"st":0.891234567
"us": 0.123456789,
"sy": 0.234567891,
"ni": 0.345678912,
"id": 0.456789123,
"wa": 0.567891234,
"hi": 0.678912345,
"si": 0.789123456,
"st": 0.891234567
}
62 changes: 31 additions & 31 deletions tests/curl/Request/GetRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,6 @@ public function testCallWithDebug(): void {
$this->assertEquals(200, $res->getResponseInfo()["http_code"]);
}

/**
* Tests call() method.
*
* @return void
* @throws Exception Throws an exception if an error occurs.
*/
public function testCallWithHttpCodes(): void {

$obj = new GetRequest($this->curlConfiguration, $this->curlResourcePath);

foreach (CurlHelper::enumCodes() as $code) {

try {

$obj->addQueryData("code", $code);

$res = $obj->call();
$this->assertEquals($code, $res->getResponseInfo()["http_code"]);
$this->assertGreaterThanOrEqual(200, $res->getResponseInfo()["http_code"]);
$this->assertLessThanOrEqual(299, $res->getResponseInfo()["http_code"]);
} catch (Exception $ex) {

$this->assertInstanceOf(RequestCallException::class, $ex);

/** @var RequestCallException $ex */
$this->assertEquals($code, $ex->getCode());
$this->assertEquals($code, $ex->getResponse()->getResponseInfo()["http_code"]);
}
}
}

/**
* Tests call() method.
*
Expand Down Expand Up @@ -140,6 +109,37 @@ public function testCallWithHeaderApplicationJSON(): void {
$this->assertEquals(200, $res->getResponseInfo()["http_code"]);
}

/**
* Tests call() method.
*
* @return void
* @throws Exception Throws an exception if an error occurs.
*/
public function testCallWithHttpCodes(): void {

$obj = new GetRequest($this->curlConfiguration, $this->curlResourcePath);

foreach (CurlHelper::enumCodes() as $code) {

try {

$obj->addQueryData("code", $code);

$res = $obj->call();
$this->assertEquals($code, $res->getResponseInfo()["http_code"]);
$this->assertGreaterThanOrEqual(200, $res->getResponseInfo()["http_code"]);
$this->assertLessThanOrEqual(299, $res->getResponseInfo()["http_code"]);
} catch (Exception $ex) {

$this->assertInstanceOf(RequestCallException::class, $ex);

/** @var RequestCallException $ex */
$this->assertEquals($code, $ex->getCode());
$this->assertEquals($code, $ex->getResponse()->getResponseInfo()["http_code"]);
}
}
}

/**
* Tests call() method.
*
Expand Down
1 change: 0 additions & 1 deletion tests/sorter/Helper/AlphabeticalTreeNodeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public function testRemoveOrphan(): void {
$this->assertCount(7, $this->nodes);
}


/**
* Tests sort()
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace WBW\Library\Symfony\Tests\Service;

use WBW\Library\Symfony\Service\TokenGeneratorService;
use WBW\Library\Symfony\Service\TokenGeneratorServiceInterface;
use WBW\Library\Symfony\Tests\AbstractTestCase;

Expand Down
1 change: 0 additions & 1 deletion tests/symfony/Service/TokenGeneratorServiceTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace WBW\Library\Symfony\Tests\Service;

use WBW\Library\Symfony\Service\TokenGeneratorService;
use WBW\Library\Symfony\Service\TokenGeneratorServiceInterface;
use WBW\Library\Symfony\Tests\AbstractTestCase;
use WBW\Library\Symfony\Tests\Fixtures\Service\TestTokenGeneratorServiceTrait;
Expand Down
1 change: 0 additions & 1 deletion tests/symfony/Service/UploadedFileServiceInterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace WBW\Library\Symfony\Tests\Service;

use WBW\Library\Symfony\Service\TokenGeneratorService;
use WBW\Library\Symfony\Service\UploadedFileServiceInterface;
use WBW\Library\Symfony\Tests\AbstractTestCase;

Expand Down

0 comments on commit e8e780a

Please sign in to comment.