Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
[2.1] Autowiring fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Free Man committed Feb 13, 2018
1 parent 620870e commit 6c0fee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ services:
class: Wolnosciowiec\FileRepositoryBundle\Service\Http\Client
public: true

wolnosciowiec.file_repository.registry:
Wolnosciowiec\FileRepositoryBundle\Service\FileRegistry:
class: Wolnosciowiec\FileRepositoryBundle\Service\FileRegistry
public: true
arguments:
$client: '@Wolnosciowiec\FileRepositoryBundle\Service\Http\Client'

wolnosciowiec.file_repository.uploader:
Wolnosciowiec\FileRepositoryBundle\Service\FileUploader:
class: Wolnosciowiec\FileRepositoryBundle\Service\FileUploader
public: true
arguments:
$client: '@Wolnosciowiec\FileRepositoryBundle\Service\Http\Client'

wolnosciowiec.file_repository.token_manager:
Wolnosciowiec\FileRepositoryBundle\Service\TokenManager:
class: Wolnosciowiec\FileRepositoryBundle\Service\TokenManager
public: true
arguments:
$client: '@Wolnosciowiec\FileRepositoryBundle\Service\Http\Client'

wolnosciowiec.file_repository.user_upload_manager:
Wolnosciowiec\FileRepositoryBundle\Service\UserUploadManager:
class: Wolnosciowiec\FileRepositoryBundle\Service\UserUploadManager
public: true
arguments:
Expand Down
10 changes: 6 additions & 4 deletions Tests/Functional/UploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Wolnosciowiec\FileRepositoryBundle\Tests\Functional;

use Wolnosciowiec\FileRepositoryBundle\Service\FileRegistry;
use Wolnosciowiec\FileRepositoryBundle\Service\FileUploader;
use Wolnosciowiec\FileRepositoryBundle\Tests\ContainerAwareTestCase;

class UploadTest extends ContainerAwareTestCase
Expand All @@ -17,17 +19,17 @@ public function testUploadByUrl()
$imageUrl = 'https://avatars0.githubusercontent.com/u/22785395';

// add a file
$this->assertNotEmpty($this->container->get('wolnosciowiec.file_repository.uploader')
$this->assertNotEmpty($this->container->get(FileUploader::class)
->uploadFromUrl($imageUrl));

$this->assertTrue($this->container->get('wolnosciowiec.file_repository.registry')
$this->assertTrue($this->container->get(FileRegistry::class)
->fileExists($imageUrl));

// delete a file
$this->container->get('wolnosciowiec.file_repository.registry')
$this->container->get(FileRegistry::class)
->deleteFile($imageUrl);

$this->assertFalse($this->container->get('wolnosciowiec.file_repository.registry')
$this->assertFalse($this->container->get(FileRegistry::class)
->fileExists($imageUrl));
}
}
3 changes: 2 additions & 1 deletion Tests/Service/TokenManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Tests\Service;

use Wolnosciowiec\FileRepositoryBundle\Exception\FileRepositoryRequestFailureException;
use Wolnosciowiec\FileRepositoryBundle\Service\TokenManager;
use Wolnosciowiec\FileRepositoryBundle\Tests\ContainerAwareTestCase;

/**
Expand All @@ -15,7 +16,7 @@ class TokenManagerTest extends ContainerAwareTestCase
*/
public function testRequestTemporaryToken()
{
$token = $this->container->get('wolnosciowiec.file_repository.token_manager')->requestTemporaryToken(
$token = $this->container->get(TokenManager::class)->requestTemporaryToken(
['test_role1'],
['uploads']
);
Expand Down

0 comments on commit 6c0fee8

Please sign in to comment.