public function testAddWords() { $censor = new CensorWords(); $censor->addDictionary('fr'); $this->assertNotEmpty($censor->badwords); $string1 = $censor->censorString('testing'); $this->assertEquals('testing', $string1['clean']); $words = ['testing', 'additional']; $censor->addWords($words); $string2 = $censor->censorString('testing'); $this->assertEquals('*******', $string2['clean']); }