Skip to content

Commit 4777d4a

Browse files
committed
SDK-752: Remove tests for private methods
1 parent 14887b3 commit 4777d4a

File tree

2 files changed

+1
-57
lines changed

2 files changed

+1
-57
lines changed

tests/TestCase.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,5 @@
66

77
class TestCase extends PHPUnit_Framework_TestCase
88
{
9-
/**
10-
* Call protected/private method of a class.
11-
*
12-
* @param object $class Class that we will run method on.
13-
* @param string $methodName Method name to call
14-
* @param array $parameters Array of parameters to pass into method.
15-
*
16-
* @return mixed Method return.
17-
*/
18-
public function invokeStaticMethod($class, $methodName, array $parameters = array())
19-
{
20-
$reflection = new \ReflectionClass($class);
21-
$method = $reflection->getMethod($methodName);
22-
$method->setAccessible(true);
23-
return $method->invokeArgs(new $class, $parameters);
24-
}
9+
2510
}

tests/Util/Profile/AttributeConverterTest.php

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -76,45 +76,4 @@ public function testConvertToYotiAttributeNullValue() {
7676
$this->assertNull($attr);
7777
}
7878

79-
/**
80-
* @covers ::convertValueBasedOnContentType
81-
* @covers ::validateInput
82-
*/
83-
public function testConvertValueBasedOnContentTypeValidation() {
84-
$this->expectException(AttributeException::class);
85-
$this->expectExceptionMessage('Warning: test_attr value is NULL');
86-
$this->invokeStaticMethod(
87-
AttributeConverter::class,
88-
'convertValueBasedOnContentType',
89-
[$this->getMockForProtobufAttribute('test_attr', '')]
90-
);
91-
}
92-
93-
/**
94-
* @covers ::convertValueBasedOnAttributeName
95-
* @covers ::validateInput
96-
*/
97-
public function testConvertValueBasedOnAttributeNameValidation() {
98-
$this->expectException(AttributeException::class);
99-
$this->expectExceptionMessage('Warning: test_attr value is NULL');
100-
$this->invokeStaticMethod(
101-
AttributeConverter::class,
102-
'convertValueBasedOnAttributeName',
103-
['', 'test_attr']
104-
);
105-
}
106-
107-
/**
108-
* @covers ::validateInput
109-
*/
110-
public function testValidateInput() {
111-
$this->expectException(AttributeException::class);
112-
$this->expectExceptionMessage('Warning: test_attr value is NULL');
113-
$this->invokeStaticMethod(
114-
AttributeConverter::class,
115-
'validateInput',
116-
['', 'test_attr']
117-
);
118-
}
119-
12079
}

0 commit comments

Comments
 (0)