4
4
5
5
class DeepLTest extends \PHPUnit_Framework_TestCase
6
6
{
7
+ /**
8
+ * Get protected method
9
+ *
10
+ * @param $className
11
+ * @param $methodName
12
+ *
13
+ * @return \ReflectionMethod
14
+ */
7
15
protected static function getMethod ($ className , $ methodName )
8
16
{
9
17
$ class = new \ReflectionClass ($ className );
@@ -13,6 +21,9 @@ protected static function getMethod($className, $methodName)
13
21
return $ method ;
14
22
}
15
23
24
+ /**
25
+ * Test checkLanguages()
26
+ */
16
27
public function testCheckLanguages ()
17
28
{
18
29
$ authKey = '123456 ' ;
@@ -25,6 +36,9 @@ public function testCheckLanguages()
25
36
$ this ->assertTrue ($ return );
26
37
}
27
38
39
+ /**
40
+ * Test checkLanguages() with exception for source language
41
+ */
28
42
public function testCheckLanguagesSourceLanguageException ()
29
43
{
30
44
$ authKey = '123456 ' ;
@@ -37,6 +51,9 @@ public function testCheckLanguagesSourceLanguageException()
37
51
$ checkLanguages ->invokeArgs ($ deepl , array ('fo ' , 'en ' ));
38
52
}
39
53
54
+ /**
55
+ * Test checkLanguages() with exception for destination language
56
+ */
40
57
public function testCheckLanguagesDestinationLanguageException ()
41
58
{
42
59
$ authKey = '123456 ' ;
@@ -49,6 +66,9 @@ public function testCheckLanguagesDestinationLanguageException()
49
66
$ checkLanguages ->invokeArgs ($ deepl , array ('de ' , 'fo ' ));
50
67
}
51
68
69
+ /**
70
+ * Test buildUrl()
71
+ */
52
72
public function testBuildUrl ()
53
73
{
54
74
$ expectedString = 'https://api.deepl.com/v1/translate?auth_key=123456&text=Hallo%20Welt&source_lang=de&target_lang=en ' ;
0 commit comments