示例#1
0
    /**
     * test that wordWrap() properly handle newline characters.
     *
     * @return void
     */
    public function testWordWrapNewlineAware()
    {
        $text = 'This is a line that is almost the 55 chars long.
This is a new sentence which is manually newlined, but is so long it needs two lines.';
        $result = Text::wordWrap($text, 55);
        $expected = <<<TEXT
This is a line that is almost the 55 chars long.
This is a new sentence which is manually newlined, but
is so long it needs two lines.
TEXT;
        $this->assertTextEquals($expected, $result, 'Text not wrapped.');
    }
示例#2
0
 public function sql($query, $label, $trace)
 {
     $sql = \Cake\Utility\Text::wordWrap($query->sql(), 80);
     $values = $query->valueBinder()->bindings();
     $sql = $this->popuateSql($sql, $values);
     $values = ['sql' => $sql, 'bindings' => $values];
     $this->osd($values, $label, $trace);
 }