Bolt\Tests\Controller\Async\FilesystemManagerTest::testRename PHP Метод

testRename() публичный Метод

Test renaming both files and folders, since the controller actions have the same signature and output
public testRename ( )
    public function testRename()
    {
        $definitions = ['file' => ['old' => self::FILE_NAME, 'new' => self::FILE_NAME_2], 'folder' => ['old' => self::FOLDER_NAME, 'new' => self::FOLDER_NAME_2]];
        foreach ($definitions as $object => $data) {
            $this->createObject($object, $data['old']);
            // Rename the object
            $response = $this->renameObject($object, $data['old'], $data['new']);
            $this->assertInstanceOf(JsonResponse::class, $response);
            $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
            $this->assertFalse($this->getService('filesystem')->has(self::FILESYSTEM . '://' . $data['old']));
            $this->assertTrue($this->getService('filesystem')->has(self::FILESYSTEM . '://' . $data['new']));
        }
    }