/** * __construct() should return word element if parameter is not null */ public function testConstruct_returnsElement_ifParameterIsNotNull() { $parameter = 1; $word = new Word($parameter); $this->assertTrue($word instanceof Word); $this->assertEquals('word', $word->getWord()); $this->assertEquals($parameter, $word->getParameter()); return; }
/** * @dataProvider dataProviderTestParse */ public function testParse($string, $getWord, array $getStyles, $hasWord, $hasStyles, $isStyle) { $word = new Word($string); $this->assertSame($string, $word->getRawString()); $this->assertSame($getWord, $word->getWord()); $this->assertSame($getStyles, $word->getStyles()); $this->assertSame($hasWord, $word->hasWord()); $this->assertSame($hasStyles, $word->hasStyles()); $this->assertSame($isStyle, $word->isStyle()); }