Skip to content

Commit

Permalink
Update deleteFiles parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Nov 6, 2024
1 parent 904dfb0 commit b8f7dd8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ApiPlatform/Resources/Module/BulkModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ class BulkModules

public bool $enabled;

public bool $deleteFile;
public bool $deleteFiles;
}
2 changes: 1 addition & 1 deletion src/ApiPlatform/Resources/Module/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Module

public bool $installed;

public bool $deleteFile;
public bool $deleteFiles;

public string $source;
}
8 changes: 4 additions & 4 deletions tests/Integration/ApiPlatform/ModuleEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ public function testUninstallModule()
'installed' => false,
];

// Uninstall specific module deleteFile true
// Uninstall specific module deleteFiles true
$bearerToken = $this->getBearerToken(['module_write']);
static::createClient()->request('PUT', sprintf('/module/%s/uninstall', $expectedModule['technicalName']), [
'auth_bearer' => $bearerToken,
'json' => [
// We keep files, so we can check the module status afterward (deleted module would return a 404)
'deleteFile' => false,
'deleteFiles' => false,
],
]);
self::assertResponseStatusCodeSame(204);
Expand All @@ -435,14 +435,14 @@ public function testBulkUninstallModule()
$this->assertTrue(version_compare($moduleInfos['installedVersion'], '0.1.0', '>='));
}

// uninstall specific module deleteFile true
// uninstall specific module deleteFiles true
$bearerToken = $this->getBearerToken(['module_write']);
static::createClient()->request('PUT', sprintf('/modules/uninstall'), [
'auth_bearer' => $bearerToken,
'json' => [
'modules' => $modules,
// Force removal of the files
'deleteFile' => true,
'deleteFiles' => true,
],
]);
self::assertResponseStatusCodeSame(204);
Expand Down

0 comments on commit b8f7dd8

Please sign in to comment.