Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

BaseAdapterTest.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 3.44 KiB


001  <?php
002  /*
003   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
004   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
005   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
006   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
007   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
008   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
009   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
010   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
011   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
012   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
013   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
014   *
015   * This software consists of voluntary contributions made by many individuals
016   * and is licensed under the MIT license.
017   */
018   
019  namespace ProxyManagerTest\Factory\RemoteObject\Adapter;
020   
021  use PHPUnit_Framework_TestCase;
022  use ProxyManager\Factory\RemoteObject\Adapter\Soap;
023   
024  /**
025   * Tests for {@see \ProxyManager\Factory\RemoteObject\Adapter\Soap}
026   *
027   * @author Vincent Blanchon <blanchon.vincent@gmail.com>
028   * @license MIT
029   *
030   * @group Coverage
031   */
032  class BaseAdapterTest extends PHPUnit_Framework_TestCase
033  {
034      /**
035       * {@inheritDoc}
036       *
037       * @covers \ProxyManager\Factory\RemoteObject\Adapter\BaseAdapter::__construct
038       * @covers \ProxyManager\Factory\RemoteObject\Adapter\BaseAdapter::call
039       * @covers \ProxyManager\Factory\RemoteObject\Adapter\Soap::getServiceName
040       */
041      public function testBaseAdapter()
042      {
043          $client = $this
044              ->getMockBuilder('Zend\Server\Client')
045              ->setMethods(array('call'))
046              ->getMock();
047   
048          $adapter = $this->getMockForAbstractClass(
049              'ProxyManager\\Factory\\RemoteObject\\Adapter\\BaseAdapter',
050              array($client)
051          );
052   
053          $client
054              ->expects($this->once())
055              ->method('call')
056              ->with('foobarbaz', array('tab' => 'taz'))
057              ->will($this->returnValue('baz'));
058   
059          $adapter
060              ->expects($this->once())
061              ->method('getServiceName')
062              ->with('foo', 'bar')
063              ->will($this->returnValue('foobarbaz'));
064   
065          $this->assertSame('baz', $adapter->call('foo', 'bar', array('tab' => 'taz')));
066      }
067   
068      /**
069       * {@inheritDoc}
070       *
071       * @covers \ProxyManager\Factory\RemoteObject\Adapter\BaseAdapter::__construct
072       * @covers \ProxyManager\Factory\RemoteObject\Adapter\BaseAdapter::call
073       * @covers \ProxyManager\Factory\RemoteObject\Adapter\Soap::getServiceName
074       */
075      public function testBaseAdapterWithServiceMap()
076      {
077          $client = $this
078              ->getMockBuilder('Zend\Server\Client')
079              ->setMethods(array('call'))
080              ->getMock();
081   
082          $adapter = $this->getMockForAbstractClass(
083              'ProxyManager\\Factory\\RemoteObject\\Adapter\\BaseAdapter',
084              array($client, array('foobarbaz' => 'mapped'))
085          );
086   
087          $client
088              ->expects($this->once())
089              ->method('call')
090              ->with('mapped', array('tab' => 'taz'))
091              ->will($this->returnValue('baz'));
092   
093          $adapter
094              ->expects($this->once())
095              ->method('getServiceName')
096              ->with('foo', 'bar')
097              ->will($this->returnValue('foobarbaz'));
098   
099          $this->assertSame('baz', $adapter->call('foo', 'bar', array('tab' => 'taz')));
100      }
101  }
102