* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Tests\Exception; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Exception\FileLoaderLoadException; class FileLoaderLoadExceptionTest extends TestCase { public function testMessageCannotLoadResource() { $exception = new FileLoaderLoadException('resource', null); $this->assertEquals('Cannot load resource "resource".', $exception->getMessage()); } public function testMessageCannotLoadResourceWithType() { $exception = new FileLoaderLoadException('resource', null, null, null, 'foobar'); $this->assertEquals('Cannot load resource "resource". Make sure there is a loader supporting the "foobar" type.', $exception->getMessage()); } public function testMessageCannotLoadResourceWithAnnotationType() { $exception = new FileLoaderLoadException('resource', null, null, null, 'annotation'); $this->assertEquals('Cannot load resource "resource". Make sure annotations are installed and enabled.', $exception->getMessage()); } public function testMessageCannotImportResourceFromSource() { $exception = new FileLoaderLoadException('resource', 'sourceResource'); $this->assertEquals('Cannot import resource "resource" from "sourceResource".', $exception->getMessage()); } public function testMessageCannotImportBundleResource() { $exception = new FileLoaderLoadException('@resource', 'sourceResource'); $this->assertEquals( 'Cannot import resource "@resource" from "sourceResource". '. 'Make sure the "resource" bundle is correctly registered and loaded in the application kernel class. '. 'If the bundle is registered, make sure the bundle path "@resource" is not empty.', $exception->getMessage() ); } public function testMessageHasPreviousErrorWithDotAndUnableToLoad() { $exception = new FileLoaderLoadException( 'resource', null, null, new \Exception('There was a previous error with an ending dot.') ); $this->assertEquals( 'There was a previous error with an ending dot in resource (which is loaded in resource "resource").', $exception->getMessage() ); } public function testMessageHasPreviousErrorWithoutDotAndUnableToLoad() { $exception = new FileLoaderLoadException( 'resource', null, null, new \Exception('There was a previous error with no ending dot') ); $this->assertEquals( 'There was a previous error with no ending dot in resource (which is loaded in resource "resource").', $exception->getMessage() ); } public function testMessageHasPreviousErrorAndUnableToLoadBundle() { $exception = new FileLoaderLoadException( '@resource', null, null, new \Exception('There was a previous error with an ending dot.') ); $this->assertEquals( 'There was a previous error with an ending dot in @resource '. '(which is loaded in resource "@resource"). '. 'Make sure the "resource" bundle is correctly registered and loaded in the application kernel class. '. 'If the bundle is registered, make sure the bundle path "@resource" is not empty.', $exception->getMessage() ); } } __halt_compiler();----SIGNATURE:----iF0wmzGMnt8W9G/6tl3iOkxvadk+YJy+h9vr7Knok8Mwmtd28nV7ZyOjg26vWqx8Y7WsXU5fb1fIhwRJqj0XXO5gXN0FMsbacjxouVKgfQU31xKfxtBHjX3wEqc1OdF6RibXQlYytCoFWElPw+NzobungzqRrIzljQ3e2yyMbf5ZHGv5MffCSIr8miLkQP5/VYZlj+BFav7fw8iB0hoAfB8axpJsFCQvTigRBgFZHUNBiaofc+Z5ACG4trCfaqIqZb3r3mSMGmkAH1vPc7Nq/poRwuQG7Mm+H1ablbNpOjvNtorrlerB+Fs0bxZ0SNM379zUuW7HE5ByQbDAr+7NQMVEG1je8QV5wXe5RE+qFd1SUdmAz3ZqB0AJrYOuJWSTnN56llb+T/9LNrwVD3B5A+4gCZNhZ3iicN1NE7RMF+VPeKrcXczhpvi8rPSjbxrep2mOSWGtsyZ2nO8WRusT8E79T/mYuhnJeAQsRDmUgG4vzdagpmz37YhIAYR9HJUh69NHlxbRnn+i9y7j2YzFaQGVZyOlzzDUU7ZV3djDyfKtVs6fev6a7Ius1BIhfoamBAtasl4bO9RaiLLLJVt7TgdFEV0hEBKBozbXiWYPjN2Atil2aToFZWpraB+lG0iwzi+FoniuIHkAOuQtTE6Go3A2Z+Uk1X4zVmG1uFi/J4w=----ATTACHMENT:----NTQ1MTg5MTEyMjU3Njk2NiA2NTE0MTkzODA5MjI2MTY0IDc1ODI2NzQ3NDg2MDU3MTM=