styles() public method

Handles styling output.
public styles ( array | boolean $styles = [] ) : array
$styles array | boolean
return array
Example #1
0
 public function testStyledOutput()
 {
     $base = Libraries::get(true, 'resources') . '/tmp/tests';
     $this->skipIf(!is_writable($base), "Path `{$base}` is not writable.");
     $response = new Response(array('output' => fopen($this->streams['output'], 'w+')));
     $response->styles(array('heading' => ""));
     $response->output('{:heading}ok');
     $this->assertEqual("ok", file_get_contents($this->streams['output']));
 }
Example #2
0
 public function testStyledOutput()
 {
     $base = Libraries::get(true, 'resources') . '/tmp/tests';
     $this->skipIf(!is_writable($base), "Path `{$base}` is not writable.");
     $response = new Response(array('output' => fopen($this->streams['output'], 'w+')));
     $response->styles(array('heading' => ""));
     $response->output('{:heading}ok');
     $expected = "ok";
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $expected = 'ok';
     }
     $this->assertEqual($expected, file_get_contents($this->streams['output']));
 }