-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement PSR-11 #13060
Merged
Merged
Implement PSR-11 #13060
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4e94a1c
Implement PSR-11
MauricioFauth 9839caf
Fix trailing whitespace
MauricioFauth fafdc06
Add ContainerTest
MauricioFauth e745255
Remove unused classes [skip ci]
MauricioFauth b0121f9
Apply requested changes and add more tests
MauricioFauth 48897b3
Fix uncaught NotFoundException
MauricioFauth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply requested changes and add more tests
Remove try-catch blocks Refactor has method Refactor testGetWithInvalidEntry method Add tests for ContainerException and NotFoundException Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
- Loading branch information
commit b0121f9f44da15ada510f2527715888e478705a2
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,77 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* Tests for PMA\libraries\di\ContainerException class | ||
* | ||
* @package PhpMyAdmin-test | ||
*/ | ||
|
||
/* | ||
* Include to test. | ||
*/ | ||
require_once 'test/PMATestCase.php'; | ||
|
||
use PMA\libraries\di\ContainerException; | ||
|
||
/** | ||
* Tests for PMA\libraries\di\ContainerException class | ||
* | ||
* @package PhpMyAdmin-test | ||
*/ | ||
class ContainerExceptionTest extends PMATestCase | ||
{ | ||
/** | ||
* @access protected | ||
*/ | ||
protected $exception; | ||
|
||
/** | ||
* Sets up the fixture. | ||
* This method is called before a test is executed. | ||
* | ||
* @access protected | ||
* @return void | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->exception = new ContainerException(); | ||
} | ||
|
||
/** | ||
* Tears down the fixture. | ||
* This method is called after a test is executed. | ||
* | ||
* @access protected | ||
* @return void | ||
*/ | ||
protected function tearDown() | ||
{ | ||
unset($this->exception); | ||
} | ||
|
||
/** | ||
* Test for ContainerException | ||
* | ||
* @return void | ||
*/ | ||
public function testContainerExceptionImplementsInteface() | ||
{ | ||
$this->assertInstanceOf( | ||
'Psr\Container\ContainerExceptionInterface', | ||
$this->exception | ||
); | ||
} | ||
|
||
/** | ||
* Test for ContainerException | ||
* | ||
* @return void | ||
*/ | ||
public function testContainerExceptionExtendsException() | ||
{ | ||
$this->assertInstanceOf( | ||
'Exception', | ||
$this->exception | ||
); | ||
} | ||
} |
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,90 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* Tests for PMA\libraries\di\NotFoundException class | ||
* | ||
* @package PhpMyAdmin-test | ||
*/ | ||
|
||
/* | ||
* Include to test. | ||
*/ | ||
require_once 'test/PMATestCase.php'; | ||
|
||
use PMA\libraries\di\NotFoundException; | ||
|
||
/** | ||
* Tests for PMA\libraries\di\NotFoundException class | ||
* | ||
* @package PhpMyAdmin-test | ||
*/ | ||
class NotFoundExceptionTest extends PMATestCase | ||
{ | ||
/** | ||
* @access protected | ||
*/ | ||
protected $exception; | ||
|
||
/** | ||
* Sets up the fixture. | ||
* This method is called before a test is executed. | ||
* | ||
* @access protected | ||
* @return void | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->exception = new NotFoundException(); | ||
} | ||
|
||
/** | ||
* Tears down the fixture. | ||
* This method is called after a test is executed. | ||
* | ||
* @access protected | ||
* @return void | ||
*/ | ||
protected function tearDown() | ||
{ | ||
unset($this->exception); | ||
} | ||
|
||
/** | ||
* Test for NotFoundException | ||
* | ||
* @return void | ||
*/ | ||
public function testNotFoundExceptionImplementsInteface() | ||
{ | ||
$this->assertInstanceOf( | ||
'Psr\Container\NotFoundExceptionInterface', | ||
$this->exception | ||
); | ||
} | ||
|
||
/** | ||
* Test for NotFoundException | ||
* | ||
* @return void | ||
*/ | ||
public function testNotFoundExceptionExtendsContainerExceptionInteface() | ||
{ | ||
$this->assertInstanceOf( | ||
'Psr\Container\ContainerExceptionInterface', | ||
$this->exception | ||
); | ||
} | ||
|
||
/** | ||
* Test for NotFoundException | ||
* | ||
* @return void | ||
*/ | ||
public function testContainerExceptionExtendsException() | ||
{ | ||
$this->assertInstanceOf( | ||
'Exception', | ||
$this->exception | ||
); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't get the code here:
try { throw } catch {}
block at all?