Commit e630c782 authored by catch's avatar catch

Issue #2572631 by ZeiP, Mile23, mfernea, pk188, dimaro, kporras07, attiks,...

Issue #2572631 by ZeiP, Mile23, mfernea, pk188, dimaro, kporras07, attiks, klausi, dawehner: Fix 'Drupal.Classes.InterfaceName' coding standard
parent 5da4584d
<?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\Database;
......
......@@ -20,6 +20,7 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/FullyQualifiedNamespaceSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/InterfaceNameSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UnusedUseStatementSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UseLeadingBackslashSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php"/>
......
......@@ -96,9 +96,9 @@ public function testGetWildcardArgument() {
* Tests getArgument() with a Route, Request, and Account object.
*/
public function testGetArgumentOrder() {
$a1 = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface1');
$a1 = $this->getMock('\Drupal\Tests\Component\Utility\Test1Interface');
$a2 = $this->getMock('\Drupal\Tests\Component\Utility\TestClass');
$a3 = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface2');
$a3 = $this->getMock('\Drupal\Tests\Component\Utility\Test2Interface');
$objects = [
't1' => $a1,
......@@ -107,12 +107,12 @@ public function testGetArgumentOrder() {
$wildcards = [$a3];
$resolver = new ArgumentsResolver([], $objects, $wildcards);
$callable = function(TestInterface1 $t1, TestClass $tc, TestInterface2 $t2) {};
$callable = function(Test1Interface $t1, TestClass $tc, Test2Interface $t2) {};
$arguments = $resolver->getArguments($callable);
$this->assertSame([$a1, $a2, $a3], $arguments);
// Test again, but with the arguments in a different order.
$callable = function(TestInterface2 $t2, TestClass $tc, TestInterface1 $t1) {};
$callable = function(Test2Interface $t2, TestClass $tc, Test1Interface $t1) {};
$arguments = $resolver->getArguments($callable);
$this->assertSame([$a3, $a2, $a1], $arguments);
}
......@@ -123,7 +123,7 @@ public function testGetArgumentOrder() {
* Without the typehint, the wildcard object will not be passed to the callable.
*/
public function testGetWildcardArgumentNoTypehint() {
$a = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface1');
$a = $this->getMock('\Drupal\Tests\Component\Utility\Test1Interface');
$wildcards = [$a];
$resolver = new ArgumentsResolver([], [], $wildcards);
......@@ -196,13 +196,13 @@ public function access($foo) {
/**
* Provides a test interface.
*/
interface TestInterface1 {
interface Test1Interface {
}
/**
* Provides a different test interface.
*/
interface TestInterface2 {
interface Test2Interface {
}
function test_access_arguments_resolver_access($foo) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment