Ported WriterTest to PHPUnit