Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools #459

Merged
merged 2 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage/>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
Expand All @@ -13,4 +9,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
22 changes: 11 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.6.0@77feecb3707bd50378c21ae4d3fe9e320e6cea65">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/Block/Service/SpaceStatisticBlockService.php">
<ParamNameMismatch occurrences="1">
<ParamNameMismatch>
<code>$formMapper</code>
</ParamNameMismatch>
</file>
<file src="src/Service/AbstractService.php">
<InvalidScalarArgument occurrences="1">
<code>$fault-&gt;getCode()</code>
</InvalidScalarArgument>
</file>
<file src="src/Service/AuthService.php">
<InvalidScalarArgument occurrences="1">
<code>$fault-&gt;getCode()</code>
</InvalidScalarArgument>
<file src="src/DependencyInjection/Configuration.php">
<UndefinedMethod>
<code>addDefaultsIfNotSet</code>
<code>append</code>
<code>append</code>
<code>append</code>
<code>children</code>
<code>fixXmlConfig</code>
</UndefinedMethod>
</file>
</files>
4 changes: 1 addition & 3 deletions src/Block/Service/SpaceStatisticBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@
'template' => '@NucleosAllInkl/Block/block_space_statistic.html.twig',
]);

$resolver->setRequired(['login', 'password']);

Check warning on line 120 in src/Block/Service/SpaceStatisticBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function configureSettings(OptionsResolver $resolver) : void { $resolver->setDefaults(['title' => null, 'translation_domain' => null, 'icon' => 'fa fa-bar-chart-o', 'class' => null, 'login' => null, 'password' => null, 'template' => '@NucleosAllInkl/Block/block_space_statistic.html.twig']); - $resolver->setRequired(['login', 'password']); + $resolver->setRequired(['password']); } public function validate(ErrorElement $errorElement, BlockInterface $block) : void {

Check warning on line 120 in src/Block/Service/SpaceStatisticBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function configureSettings(OptionsResolver $resolver) : void { $resolver->setDefaults(['title' => null, 'translation_domain' => null, 'icon' => 'fa fa-bar-chart-o', 'class' => null, 'login' => null, 'password' => null, 'template' => '@NucleosAllInkl/Block/block_space_statistic.html.twig']); - $resolver->setRequired(['login', 'password']); + } public function validate(ErrorElement $errorElement, BlockInterface $block) : void {
}

public function validate(ErrorElement $errorElement, BlockInterface $block): void
{
}
public function validate(ErrorElement $errorElement, BlockInterface $block): void {}

Check warning on line 123 in src/Block/Service/SpaceStatisticBlockService.php

View check run for this annotation

Codecov / codecov/patch

src/Block/Service/SpaceStatisticBlockService.php#L123

Added line #L123 was not covered by tests

public function getMetadata(): MetadataInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Exception/AllInklException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

use Exception;

final class AllInklException extends Exception
{
}
final class AllInklException extends Exception {}
1 change: 0 additions & 1 deletion src/Resources/config/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
->call('setLogger', [
new Reference('logger'),
])

;
};
1 change: 0 additions & 1 deletion src/Resources/config/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@
new Parameter('nucleos_allinkl.check.accounts'),
new Parameter('nucleos_allinkl.check.warning'),
])

;
};
1 change: 0 additions & 1 deletion src/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@
->args([
new Parameter('nucleos_allinkl.api.api_endpoint'),
])

;
};
3 changes: 0 additions & 3 deletions src/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ abstract class AbstractService implements LoggerAwareInterface
*/
private $endpoint;

/**
* @param string $endpoint
*/
public function __construct(string $endpoint = null)
{
if (null === $endpoint) {
Expand Down
5 changes: 1 addition & 4 deletions src/Service/AuthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@
*/
private const DEFAULT_AUTH_ENDPOINT = 'https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl';

/**
* @param string $endpoint
*/
public function __construct(string $endpoint = null)
{
if (null === $endpoint) {
$endpoint = static::DEFAULT_AUTH_ENDPOINT;
$endpoint = self::DEFAULT_AUTH_ENDPOINT;

Check warning on line 29 in src/Service/AuthService.php

View check run for this annotation

Codecov / codecov/patch

src/Service/AuthService.php#L29

Added line #L29 was not covered by tests
}

parent::__construct($endpoint);
Expand Down
14 changes: 7 additions & 7 deletions tests/Block/Service/SpaceStatisticBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ public function testExecute(): void
{
$session = new Session('foo', 'token');

$this->authService->expects(static::once())->method('createSession')
->with(static::equalTo('foologin'), static::equalTo('barpw'))
$this->authService->expects(self::once())->method('createSession')
->with(self::equalTo('foologin'), self::equalTo('barpw'))
->willReturn($session)
;

$dataResponse = [
['foo' => 'bar'],
];

$this->statisticService->expects(static::once())->method('getSpace')
->with(static::equalTo($session), true, true)
$this->statisticService->expects(self::once())->method('getSpace')
->with(self::equalTo($session), true, true)
->willReturn($dataResponse)
;

Expand All @@ -77,7 +77,7 @@ public function testExecute(): void

$response = new Response();

$this->twig->expects(static::once())->method('render')
$this->twig->expects(self::once())->method('render')
->with(
'@NucleosAllInkl/Block/block_space_statistic.html.twig',
[
Expand All @@ -96,8 +96,8 @@ public function testExecute(): void
$this->statisticService
);

static::assertSame($response, $blockService->execute($blockContext, $response));
static::assertSame('TWIG_CONTENT', $response->getContent());
self::assertSame($response, $blockService->execute($blockContext, $response));
self::assertSame('TWIG_CONTENT', $response->getContent());
}

public function testDefaultSettings(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/BundleIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function testStartup(): void

$client->request('GET', '/test');

static::assertSame(200, $client->getResponse()->getStatusCode());
self::assertSame(200, $client->getResponse()->getStatusCode());
}
}
4 changes: 2 additions & 2 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testOptions(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}

public function testCronOptions(): void
Expand Down Expand Up @@ -75,6 +75,6 @@ public function testCronOptions(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}
}
2 changes: 1 addition & 1 deletion tests/NucleosAllInklBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public function testGetContainerExtension(): void
{
$bundle = new NucleosAllInklBundle();

static::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension());
self::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension());
}
}
5 changes: 5 additions & 0 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"phpstan/extension-installer": true
},
"bin-dir": "../../vendor/bin"
},
"extra": {
"symfony": {
"require": "6.4.*"
}
}
}
Loading
Loading