private function _getInvocationSignature()
 {
     $class = Yay_MockGenerator::getInstance()->reverseNamingScheme(get_class($this->_object));
     if (isset($this->_method)) {
         $method = $this->_method;
     } else {
         $method = '<any method>';
     }
     if (!empty($this->_matchers)) {
         $args = array();
         foreach ($this->_matchers as $matcher) {
             $args[] = $matcher->describeMatch('%s [%s]');
         }
         $params = implode(', ', $args);
     } else {
         $params = '';
     }
     return sprintf('%s::%s(%s)', $class, $method, $params);
 }
示例#2
0
<?php

/*
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * YayMock include and bootstrap file.
 * @author Chris Corbyn
 */
require_once dirname(__FILE__) . '/classes/Yay.php';
Yay::setClassPath(dirname(__FILE__) . '/classes');
spl_autoload_register(array('Yay', 'autoload'));
Yay_MockGenerator::getInstance()->setMockTemplate(dirname(__FILE__) . '/mock.tpl.php');
//EOF
示例#3
0
 /**
  * Create a new Mockery.
  */
 public function __construct()
 {
     $this->_generator = Yay_MockGenerator::getInstance();
 }
 private function _getInvocationSignature()
 {
     $class = Yay_MockGenerator::getInstance()->reverseNamingScheme(get_class($this->_object));
     if (!empty($this->_arguments)) {
         $args = array();
         foreach ($this->_arguments as $arg) {
             $args[] = $this->_describeArgument($arg, '%s [%s]');
         }
         $params = implode(', ', $args);
     } else {
         $params = '';
     }
     return sprintf('%s::%s(%s)', $class, $this->_method, $params);
 }