public function testFactory() { $htmlFactory = new HtmlFactory(); $text = $htmlFactory->createText('hello Dr\'Huang'); $this->assertEquals('hello Dr\'Huang', $text->render()); $jsonFactory = new JsonFactory(); $text = $jsonFactory->createText(['name' => 'Dr\'Huang']); $this->assertEquals('{"name":"Dr\'Huang"}', $text->render()); }
public function testCanCreateImg() { self::assertRegExp('/<img src="name" width="100" height="200" \\/>/i', HtmlFactory::imgTag('name', 100, 200)->__toString()); }