PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@ -0,0 +1,44 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/
namespace ProxyManagerTest\Exception;
use PHPUnit_Framework_TestCase;
use ProxyManager\Exception\DisabledMethodException;
/**
* Tests for {@see \ProxyManager\Exception\DisabledMethodException}
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* @covers \ProxyManager\Exception\DisabledMethodException
* @group Coverage
*/
class DisabledMethodExceptionTest extends PHPUnit_Framework_TestCase
{
/**
* @covers \ProxyManager\Exception\DisabledMethodException::disabledMethod
*/
public function testProxyDirectoryNotFound()
{
$exception = DisabledMethodException::disabledMethod('foo::bar');
$this->assertSame('Method "foo::bar" is forcefully disabled', $exception->getMessage());
}
}

View File

@ -0,0 +1,72 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/
namespace ProxyManagerTest\Exception;
use PHPUnit_Framework_TestCase;
use ProxyManager\Exception\FileNotWritableException;
/**
* Tests for {@see \ProxyManager\Exception\FileNotWritableException}
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* @covers \ProxyManager\Exception\FileNotWritableException
* @group Coverage
*/
class FileNotWritableExceptionTest extends PHPUnit_Framework_TestCase
{
public function testFromInvalidMoveOperation()
{
$exception = FileNotWritableException::fromInvalidMoveOperation('/tmp/a', '/tmp/b');
$this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception);
$this->assertSame(
'Could not move file "/tmp/a" to location "/tmp/b": either the source file is not readable,'
. ' or the destination is not writable',
$exception->getMessage()
);
}
public function testFromNotWritableLocationWithNonFilePath()
{
$exception = FileNotWritableException::fromNonWritableLocation(__DIR__);
$this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception);
$this->assertSame(
'Could not write to path "' . __DIR__ . '": exists and is not a file',
$exception->getMessage()
);
}
public function testFromNotWritableLocationWithNonWritablePath()
{
$path = sys_get_temp_dir() . '/' . uniqid('FileNotWritableExceptionTestNonWritable', true);
mkdir($path, 0555);
$exception = FileNotWritableException::fromNonWritableLocation($path . '/foo');
$this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception);
$this->assertSame(
'Could not write to path "' . $path . '/foo": is not writable',
$exception->getMessage()
);
}
}

View File

@ -0,0 +1,67 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/
namespace ProxyManagerTest\Exception;
use PHPUnit_Framework_TestCase;
use ProxyManager\Exception\InvalidProxiedClassException;
use ReflectionClass;
/**
* Tests for {@see \ProxyManager\Exception\InvalidProxiedClassException}
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* @covers \ProxyManager\Exception\InvalidProxiedClassException
* @group Coverage
*/
class InvalidProxiedClassExceptionTest extends PHPUnit_Framework_TestCase
{
public function testInterfaceNotSupported()
{
$this->assertSame(
'Provided interface "ProxyManagerTestAsset\BaseInterface" cannot be proxied',
InvalidProxiedClassException::interfaceNotSupported(
new ReflectionClass('ProxyManagerTestAsset\BaseInterface')
)->getMessage()
);
}
public function testFinalClassNotSupported()
{
$this->assertSame(
'Provided class "ProxyManagerTestAsset\FinalClass" is final and cannot be proxied',
InvalidProxiedClassException::finalClassNotSupported(
new ReflectionClass('ProxyManagerTestAsset\FinalClass')
)->getMessage()
);
}
public function testAbstractProtectedMethodsNotSupported()
{
$this->assertSame(
'Provided class "ProxyManagerTestAsset\ClassWithAbstractProtectedMethod" has following protected abstract'
. ' methods, and therefore cannot be proxied:' . "\n"
. 'ProxyManagerTestAsset\ClassWithAbstractProtectedMethod::protectedAbstractMethod',
InvalidProxiedClassException::abstractProtectedMethodsNotSupported(
new ReflectionClass('ProxyManagerTestAsset\ClassWithAbstractProtectedMethod')
)->getMessage()
);
}
}

View File

@ -0,0 +1,44 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/
namespace ProxyManagerTest\Exception;
use PHPUnit_Framework_TestCase;
use ProxyManager\Exception\InvalidProxyDirectoryException;
/**
* Tests for {@see \ProxyManager\Exception\InvalidProxyDirectoryException}
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* @covers \ProxyManager\Exception\InvalidProxyDirectoryException
* @group Coverage
*/
class InvalidProxyDirectoryExceptionTest extends PHPUnit_Framework_TestCase
{
/**
* @covers \ProxyManager\Exception\InvalidProxyDirectoryException::proxyDirectoryNotFound
*/
public function testProxyDirectoryNotFound()
{
$exception = InvalidProxyDirectoryException::proxyDirectoryNotFound('foo/bar');
$this->assertSame('Provided directory "foo/bar" does not exist', $exception->getMessage());
}
}

View File

@ -0,0 +1,49 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/
namespace ProxyManagerTest\Exception;
use PHPUnit_Framework_TestCase;
use ProxyManager\Exception\UnsupportedProxiedClassException;
use ReflectionProperty;
/**
* Tests for {@see \ProxyManager\Exception\UnsupportedProxiedClassException}
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* @covers \ProxyManager\Exception\UnsupportedProxiedClassException
* @group Coverage
*/
class UnsupportedProxiedClassExceptionTest extends PHPUnit_Framework_TestCase
{
/**
* @covers \ProxyManager\Exception\UnsupportedProxiedClassException::unsupportedLocalizedReflectionProperty
*/
public function testUnsupportedLocalizedReflectionProperty()
{
$this->assertSame(
'Provided reflection property "property0" of class "ProxyManagerTestAsset\ClassWithPrivateProperties" '
. 'is private and cannot be localized in PHP 5.3',
UnsupportedProxiedClassException::unsupportedLocalizedReflectionProperty(
new ReflectionProperty('ProxyManagerTestAsset\ClassWithPrivateProperties', 'property0')
)->getMessage()
);
}
}