Вход Регистрация
Файл: src/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php
Строк: 34
<?php

namespace specProphecyPromise;

use 
PhpSpecObjectBehavior;

class 
ReturnArgumentPromiseSpec extends ObjectBehavior
{
    function 
it_is_promise()
    {
        
$this->shouldBeAnInstanceOf('ProphecyPromisePromiseInterface');
    }

    
/**
     * @param ProphecyProphecyObjectProphecy $object
     * @param ProphecyProphecyMethodProphecy $method
     */
    
function it_should_return_first_argument_if_provided($object$method)
    {
        
$this->execute(array('one''two'), $object$method)->shouldReturn('one');
    }

    
/**
     * @param ProphecyProphecyObjectProphecy $object
     * @param ProphecyProphecyMethodProphecy $method
     */
    
function it_should_return_null_if_no_arguments_provided($object$method)
    {
        
$this->execute(array(), $object$method)->shouldReturn(null);
    }

    
/**
     * @param ProphecyProphecyObjectProphecy $object
     * @param ProphecyProphecyMethodProphecy $method
     */
    
function it_should_return_nth_argument_if_provided($object$method)
    {
        
$this->beConstructedWith(1);
        
$this->execute(array('one''two'), $object$method)->shouldReturn('two');
    }
}
Онлайн: 1
Реклама