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

ProxiedMethodsFilterTest.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 3.66 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\ProxyGenerator\Util;
020   
021  use PHPUnit_Framework_TestCase;
022  use ProxyManager\ProxyGenerator\Util\ProxiedMethodsFilter;
023  use ReflectionClass;
024  use ReflectionMethod;
025   
026  /**
027   * Tests for {@see \ProxyManager\ProxyGenerator\Util\ProxiedMethodsFilter}
028   *
029   * @author Marco Pivetta <ocramius@gmail.com>
030   * @license MIT
031   *
032   * @covers \ProxyManager\ProxyGenerator\Util\ProxiedMethodsFilter
033   * @group Coverage
034   */
035  class ProxiedMethodsFilterTest extends PHPUnit_Framework_TestCase
036  {
037      /**
038       * @dataProvider expectedMethods
039       */
040      public function testFiltering(ReflectionClass $reflectionClass, $excludes, array $expectedMethods)
041      {
042          if (is_array($excludes)) {
043              $filtered = ProxiedMethodsFilter::getProxiedMethods($reflectionClass, $excludes);
044          } else {
045              $filtered = ProxiedMethodsFilter::getProxiedMethods($reflectionClass);
046          }
047   
048          foreach ($filtered as $method) {
049              $this->assertInstanceOf('ReflectionMethod', $method);
050          }
051   
052          $keys = array_map(
053              function (ReflectionMethod $method) {
054                  return $method->getName();
055              },
056              $filtered
057          );
058   
059          sort($keys);
060          sort($expectedMethods);
061   
062          $this->assertSame($keys, $expectedMethods);
063      }
064   
065      /**
066       * @return array[][]
067       */
068      public function expectedMethods()
069      {
070          return array(
071              array(
072                  new ReflectionClass('ProxyManagerTestAsset\\BaseClass'),
073                  null,
074                  array(
075                      'publicArrayHintedMethod',
076                      'publicByReferenceMethod',
077                      'publicByReferenceParameterMethod',
078                      'publicMethod',
079                      'publicTypeHintedMethod',
080                  ),
081              ),
082              array(
083                  new ReflectionClass('ProxyManagerTestAsset\\EmptyClass'),
084                  null,
085                  array(),
086              ),
087              array(
088                  new ReflectionClass('ProxyManagerTestAsset\\LazyLoadingMock'),
089                  null,
090                  array(),
091              ),
092              array(
093                  new ReflectionClass('ProxyManagerTestAsset\\LazyLoadingMock'),
094                  array(),
095                  array(),
096              ),
097              array(
098                  new ReflectionClass('ProxyManagerTestAsset\\HydratedObject'),
099                  array('doFoo'),
100                  array('__get'),
101              ),
102              array(
103                  new ReflectionClass('ProxyManagerTestAsset\\HydratedObject'),
104                  array('Dofoo'),
105                  array('__get'),
106              ),
107              array(
108                  new ReflectionClass('ProxyManagerTestAsset\\HydratedObject'),
109                  array(),
110                  array('doFoo', '__get'),
111              ),
112          );
113      }
114  }
115