src/Reporter/Terminal.php
protected function _reportDiff($log)
    {
        $data = $log->data();

        $this->write("It expect actual ");

        if ($log->not()) {
            $this->write('NOT ', 'cyan');
            $not = 'not ';
        } else {
            $not = '';
        }
        $this->write("to {$log->description()}\n\n");

        foreach ($data as $key => $value) {
            if (preg_match('~actual~', $key)) {
                $this->write("{$key}:\n", 'yellow');
                $this->prefix($this->format(' ', 'n;;91') . ' ');
            } elseif (preg_match('~expected~', $key)) {
                $this->write("{$not}{$key}:\n", 'yellow');
                $this->prefix($this->format(' ', 'n;;92') . ' ');
            } else {
                $this->write("{$key}:\n", 'yellow');
            }
            $type = gettype($value);
            $toString = function ($instance) {
                return 'an instance of `' . get_class($instance) . '`';
            };
            $this->write("({$type}) " . Text::toString($value, ['object' => ['method' => $toString]]));
            $this->prefix('');
            $this->write("\n");
        }
        $this->write("\n");
    }
protected function _reportDiff($log)
    {
        $data = $log->data();

        $this->write("It expect actual ");

        if ($log->not()) {
            $this->write('NOT ', 'cyan');
            $not = 'not ';
        } else {
            $not = '';
        }
        $this->write("to {$log->description()}\n\n");

        foreach ($data as $key => $value) {
            if (preg_match('~actual~', $key)) {
                $this->write("{$key}:\n", 'yellow');
                $this->prefix($this->format(' ', 'n;;91') . ' ');
            } elseif (preg_match('~expected~', $key)) {
                $this->write("{$not}{$key}:\n", 'yellow');
                $this->prefix($this->format(' ', 'n;;92') . ' ');
            } else {
                $this->write("{$key}:\n", 'yellow');
            }
            $type = gettype($value);
            $toString = function ($instance) {
                return 'an instance of `' . get_class($instance) . '`';
            };
            $this->write("({$type}) " . Text::toString($value, ['object' => ['method' => $toString]]));
            $this->prefix('');
            $this->write("\n");
        }
        $this->write("\n");
    }
protected function _reportDiff ( $ log ) { $ data = $ log -> data ( ) ; $ this -> write ( "It expect actual " ) ; if ( $ log -> not ( ) ) { $ this -> write ( 'NOT ' , 'cyan' ) ; $ not = 'not ' ; } else { $ not = '' ; } $ this -> write ( "to {$log->description()}\n\n" ) ; foreach ( $ data as $ key => $ value ) { if ( preg_match ( '~actual~' , $ key ) ) { $ this -> write ( "{$key}:\n" , 'yellow' ) ; $ this -> prefix ( $ this -> format ( ' ' , 'n;;91' ) . ' ' ) ; } elseif ( preg_match ( '~expected~' , $ key ) ) { $ this -> write ( "{$not}{$key}:\n" , 'yellow' ) ; $ this -> prefix ( $ this -> format ( ' ' , 'n;;92' ) . ' ' ) ; } else { $ this -> write ( "{$key}:\n" , 'yellow' ) ; } $ type = gettype ( $ value ) ; $ toString = function ( $ instance ) { return 'an instance of `' . get_class ( $ instance ) . '`' ; } ; $ this -> write ( "({$type}) " . Text :: toString ( $ value , [ 'object' => [ 'method' => $ toString ] ] ) ) ; $ this -> prefix ( '' ) ; $ this -> write ( "\n" ) ; } $ this -> write ( "\n" ) ; }
Print diff of spec's data.

@param array $log A log array.
Print diff of spec s data .