Updated tests to use random (md5 of unixtime) space names

This commit is contained in:
David Wakelin 2022-02-08 18:07:13 +00:00
commit bdd06aa0b7
3 changed files with 15 additions and 19 deletions

View file

@ -9,6 +9,7 @@ use SpacesAPI\Spaces;
class SpaceTest extends TestCase
{
private static $tempSpaceName;
private static $space;
public static function setUpBeforeClass(): void
@ -19,17 +20,14 @@ class SpaceTest extends TestCase
$spaces = new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']);
try {
$spaces->space('spaces-api-test')->destroy();
} catch (SpaceDoesntExistException $e) {
}
self::$tempSpaceName = md5(time());
self::$space = $spaces->create('spaces-api-test');
self::$space = $spaces->create(self::$tempSpaceName);
}
public static function tearDownAfterClass(): void
{
// (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space('spaces-api-test')->destroy();
self::$space->destroy();
}
public function testCanUpdateSpacePrivacy()