Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function testDetectOnMock() { |
||
27 | |||
28 | $languageCandidates = array( 'en', 'de', 'fr', 'es', 'ja', 'zh' ); |
||
29 | |||
30 | $textCat = $this->getMockBuilder( '\TextCat' ) |
||
31 | ->disableOriginalConstructor() |
||
32 | ->getMock(); |
||
33 | |||
34 | $textCat->expects( $this->once() ) |
||
35 | ->method( 'classify' ) |
||
36 | ->with( |
||
37 | $this->equalTo( 'Foo' ), |
||
38 | $this->equalTo( $languageCandidates ) ) |
||
39 | ->will( $this->returnValue( array() ) ); |
||
40 | |||
41 | $instance = new TextCatLanguageDetector( $textCat ); |
||
42 | $instance->setLanguageCandidates( |
||
43 | $languageCandidates |
||
44 | ); |
||
45 | |||
46 | $instance->detect( 'Foo' ); |
||
47 | } |
||
48 | |||
50 |