Fix imported ContainerInterface (#37334)

Co-authored-by: Viktor Szépe <viktor@szepe.net>
This commit is contained in:
Vedanshu Jain 2023-03-24 21:20:53 +05:30 committed by GitHub
parent 59a12a1868
commit 126187b794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Corrects imported ContainerInterface. It was not replaced because of the leading backslash.

View File

@ -6,7 +6,7 @@
namespace Automattic\WooCommerce\Proxies;
use Automattic\WooCommerce\Internal\DependencyManagement\Definition;
use Psr\Container\ContainerInterface;
use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
/**
* Proxy class to access legacy WooCommerce functionality.

View File

@ -32,7 +32,7 @@ class LegacyProxyTest extends \WC_Unit_Test_Case {
*/
public function test_get_instance_of_throws_when_trying_to_get_a_namespaced_class() {
$this->expectException( \Exception::class );
$this->expectExceptionMessage( 'The LegacyProxy class is not intended for getting instances of classes in the src directory, please use ' . Definition::INJECTION_METHOD . ' method injection or the instance of Psr\Container\ContainerInterface for that.' );
$this->expectExceptionMessage( 'The LegacyProxy class is not intended for getting instances of classes in the src directory, please use ' . Definition::INJECTION_METHOD . ' method injection or the instance of Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface for that.' );
$this->sut->get_instance_of( DependencyClass::class );
}