textClass = new \ReflectionClass('Faker\Provider\kk_KZ\Text'); } protected function getMethod($name) { $method = $this->textClass->getMethod($name); $method->setAccessible(true); return $method; } /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( 'Арыстан баб кесенесі - көне Отырар.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар ')) ); $this->assertSame( 'Арыстан баб кесенесі - көне Отырар.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар— ')) ); $this->assertSame( 'Арыстан баб кесенесі - көне Отырар.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар, ')) ); $this->assertSame( 'Арыстан баб кесенесі - көне Отырар!.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар! ')) ); $this->assertSame( 'Арыстан баб кесенесі - көне Отырар.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар: ')) ); $this->assertSame( 'Арыстан баб кесенесі - көне Отырар.', $this->getMethod('appendEnd')->invokeArgs(null, array('Арыстан баб кесенесі - көне Отырар; ')) ); } }