Issues (1446)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

tests/ProxyManagerTest/ConfigurationTest.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManagerTest;
6
7
use PHPUnit\Framework\TestCase;
8
use ProxyManager\Autoloader\AutoloaderInterface;
9
use ProxyManager\Configuration;
10
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
11
use ProxyManager\GeneratorStrategy\GeneratorStrategyInterface;
12
use ProxyManager\Inflector\ClassNameInflectorInterface;
13
use ProxyManager\Signature\ClassSignatureGeneratorInterface;
14
use ProxyManager\Signature\SignatureCheckerInterface;
15
use ProxyManager\Signature\SignatureGeneratorInterface;
16
17
/**
18
 * Tests for {@see \ProxyManager\Configuration}
19
 *
20
 * @group Coverage
21
 */
22
final class ConfigurationTest extends TestCase
23
{
24
    private Configuration $configuration;
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    protected function setUp() : void
30
    {
31
        $this->configuration = new Configuration();
32
    }
33
34
    /**
35
     * @covers \ProxyManager\Configuration::getProxiesNamespace
36
     * @covers \ProxyManager\Configuration::setProxiesNamespace
37
     */
38
    public function testGetSetProxiesNamespace() : void
39
    {
40
        self::assertSame(
41
            'ProxyManagerGeneratedProxy',
42
            $this->configuration->getProxiesNamespace(),
43
            'Default setting check for BC'
44
        );
45
46
        $this->configuration->setProxiesNamespace('foo');
47
        self::assertSame('foo', $this->configuration->getProxiesNamespace());
48
    }
49
50
    /**
51
     * @covers \ProxyManager\Configuration::getClassNameInflector
52
     * @covers \ProxyManager\Configuration::setClassNameInflector
53
     */
54
    public function testSetGetClassNameInflector() : void
55
    {
56
        /** @noinspection UnnecessaryAssertionInspection */
57
        self::assertInstanceOf(ClassNameInflectorInterface::class, $this->configuration->getClassNameInflector());
58
59
        $inflector = $this->createMock(ClassNameInflectorInterface::class);
60
61
        $this->configuration->setClassNameInflector($inflector);
62
        self::assertSame($inflector, $this->configuration->getClassNameInflector());
63
    }
64
65
    /**
66
     * @covers \ProxyManager\Configuration::getGeneratorStrategy
67
     */
68
    public function testDefaultGeneratorStrategyNeedToBeAInstanceOfEvaluatingGeneratorStrategy() : void
69
    {
70
        self::assertInstanceOf(EvaluatingGeneratorStrategy::class, $this->configuration->getGeneratorStrategy());
71
    }
72
73
    /**
74
     * @covers \ProxyManager\Configuration::getGeneratorStrategy
75
     * @covers \ProxyManager\Configuration::setGeneratorStrategy
76
     */
77
    public function testSetGetGeneratorStrategy() : void
78
    {
79
        /** @noinspection UnnecessaryAssertionInspection */
80
        self::assertInstanceOf(GeneratorStrategyInterface::class, $this->configuration->getGeneratorStrategy());
81
82
        $strategy = $this->createMock(GeneratorStrategyInterface::class);
83
84
        $this->configuration->setGeneratorStrategy($strategy);
85
        self::assertSame($strategy, $this->configuration->getGeneratorStrategy());
86
    }
87
88
    /**
89
     * @covers \ProxyManager\Configuration::getProxiesTargetDir
90
     * @covers \ProxyManager\Configuration::setProxiesTargetDir
91
     */
92
    public function testSetGetProxiesTargetDir() : void
93
    {
94
        self::assertDirectoryExists($this->configuration->getProxiesTargetDir());
95
96
        $this->configuration->setProxiesTargetDir(__DIR__);
97
        self::assertSame(__DIR__, $this->configuration->getProxiesTargetDir());
98
    }
99
100
    /**
101
     * @covers \ProxyManager\Configuration::getProxyAutoloader
102
     * @covers \ProxyManager\Configuration::setProxyAutoloader
103
     */
104
    public function testSetGetProxyAutoloader() : void
105
    {
106
        /** @noinspection UnnecessaryAssertionInspection */
107
        self::assertInstanceOf(AutoloaderInterface::class, $this->configuration->getProxyAutoloader());
108
109
        $autoloader = $this->createMock(AutoloaderInterface::class);
110
111
        $this->configuration->setProxyAutoloader($autoloader);
112
        self::assertSame($autoloader, $this->configuration->getProxyAutoloader());
113
    }
114
115
    /**
116
     * @covers \ProxyManager\Configuration::getSignatureGenerator
117
     * @covers \ProxyManager\Configuration::setSignatureGenerator
118
     */
119
    public function testSetGetSignatureGenerator() : void
120
    {
121
        /** @noinspection UnnecessaryAssertionInspection */
122
        self::assertInstanceOf(SignatureCheckerInterface::class, $this->configuration->getSignatureChecker());
123
124
        $signatureGenerator = $this->createMock(SignatureGeneratorInterface::class);
125
126
        $this->configuration->setSignatureGenerator($signatureGenerator);
127
        self::assertSame($signatureGenerator, $this->configuration->getSignatureGenerator());
128
    }
129
130
    /**
131
     * @covers \ProxyManager\Configuration::getSignatureChecker
132
     * @covers \ProxyManager\Configuration::setSignatureChecker
133
     */
134
    public function testSetGetSignatureChecker() : void
135
    {
136
        /** @noinspection UnnecessaryAssertionInspection */
137
        self::assertInstanceOf(SignatureCheckerInterface::class, $this->configuration->getSignatureChecker());
138
139
        $signatureChecker = $this->createMock(SignatureCheckerInterface::class);
140
141
        $this->configuration->setSignatureChecker($signatureChecker);
142
        self::assertSame($signatureChecker, $this->configuration->getSignatureChecker());
143
    }
144
145
    /**
146
     * @covers \ProxyManager\Configuration::getClassSignatureGenerator
147
     * @covers \ProxyManager\Configuration::setClassSignatureGenerator
148
     */
149
    public function testSetGetClassSignatureGenerator() : void
150
    {
151
        /** @noinspection UnnecessaryAssertionInspection */
152
        self::assertInstanceOf(
153
            ClassSignatureGeneratorInterface::class,
154
            $this->configuration->getClassSignatureGenerator()
155
        );
156
        $classSignatureGenerator = $this->createMock(ClassSignatureGeneratorInterface::class);
157
158
        $this->configuration->setClassSignatureGenerator($classSignatureGenerator);
159
        self::assertSame($classSignatureGenerator, $this->configuration->getClassSignatureGenerator());
160
    }
161
}
162