-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bug fixes * Test for the bug
- Loading branch information
Showing
2 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace Packaged\Dispatch\Tests\Resources; | ||
|
||
use Packaged\Dispatch\Dispatch; | ||
use Packaged\Dispatch\ResourceManager; | ||
use Packaged\Dispatch\Resources\CssResource; | ||
use Packaged\Helpers\Path; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class NestedResourceTest extends TestCase | ||
{ | ||
public function testProcessesContent() | ||
{ | ||
$root = Path::system(dirname(__DIR__), '_root'); | ||
Dispatch::bind(new Dispatch($root, '/_r/'))->addAlias('root', Path::system($root, Dispatch::RESOURCES_DIR)); | ||
$manager = ResourceManager::resources(); | ||
|
||
$resource = new CssResource(); | ||
$resource->setManager($manager); | ||
$resource->setProcessingPath('css/test.css'); | ||
$resource->setContent(file_get_contents(Path::system($root, Dispatch::RESOURCES_DIR, 'css', 'test.css'))); | ||
$content = $resource->getContent(); | ||
$this->assertContains('url(/_r/r/395d1a0e8999/img/x.jpg?x=y&request=b)', $content); | ||
} | ||
} |