Issues (80)

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.

Transport/Subscriber/SubscriberQueueBagTest.php (2 issues)

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
namespace Cmobi\RabbitmqBundle\Tests\Transport\Subscriber;
4
5
use Cmobi\RabbitmqBundle\Transport\Subscriber\ExchangeType;
6
use Cmobi\RabbitmqBundle\Transport\Subscriber\SubscriberQueueBag;
7
use Cmobi\RabbitmqBundle\Tests\BaseTestCase;
8
9
class SubscriberQueueBagTest extends BaseTestCase
10
{
11
    public function testGetQueue()
12
    {
13
        $queueBag = new SubscriberQueueBag('excharge1', ExchangeType::FANOUT, 'test');
14
15
        $this->assertEquals('test', $queueBag->getQueue());
16
    }
17
18
    public function testGetType()
19
    {
20
        $queueBag = new SubscriberQueueBag('test', ExchangeType::TOPIC);
21
22
        $this->assertEquals(ExchangeType::TOPIC, $queueBag->getType());
23
    }
24
25
    public function testGetPassive()
26
    {
27
        $queueBag = new SubscriberQueueBag('test');
28
29
        $this->assertEquals(false, $queueBag->getPassive());
30
    }
31
32
    public function testGetDurable()
33
    {
34
        $queueBag = new SubscriberQueueBag('test');
35
36
        $this->assertEquals(false, $queueBag->getDurable());
37
    }
38
39
    public function testGetAutoDelete()
40
    {
41
        $queueBag = new SubscriberQueueBag('test');
42
43
        $this->assertEquals(false, $queueBag->getAutoDelete());
44
    }
45
46
    public function testGetNoAck()
47
    {
48
        $queueBag = new SubscriberQueueBag('test');
49
50
        $this->assertEquals(true, $queueBag->getNoAck());
51
    }
52
53
    public function testGetNoLocal()
54
    {
55
        $queueBag = new SubscriberQueueBag('test');
56
57
        $this->assertEquals(false, $queueBag->getNoLocal());
58
    }
59
60
    public function testGetNoWait()
61
    {
62
        $queueBag = new SubscriberQueueBag('test');
63
64
        $this->assertEquals(false, $queueBag->getNoWait());
65
    }
66
    public function testGetArguments()
67
    {
68
        $queueBag = new SubscriberQueueBag('test');
69
70
        $this->assertEquals(null, $queueBag->getArguments());
71
    }
72
    public function testGetTicket()
73
    {
74
        $queueBag = new SubscriberQueueBag('test');
75
76
        $this->assertEquals(null, $queueBag->getTicket());
77
    }
78
79
    public function testGetQueueDeclare()
80
    {
81
        $queueBag = new SubscriberQueueBag('test');
82
83
        $this->assertEquals(
84
            [
85
                '',
86
                false,
87
                false,
88
                true,
89
                false,
90
                false,
91
                null,
92
                null,
93
            ],
94
            $queueBag->getQueueDeclare()
95
        );
96
    }
97
98
    public function testGetQueueConsume()
99
    {
100
        $queueBag = new SubscriberQueueBag('test');
101
102
        $this->assertEquals(
103
            [
104
                '',
105
                '',
106
                false,
107
                true,
108
                false,
109
                false,
110
                null,
111
                null,
112
            ],
113
            $queueBag->getQueueConsume()
114
        );
115
    }
116
117 View Code Duplication
    public function testGetExchangeDeclare()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
118
    {
119
        $queueBag = new SubscriberQueueBag('test', ExchangeType::DIRECT);
120
121
        $this->assertEquals(
122
            [
123
                'test',
124
                ExchangeType::DIRECT,
125
                false,
126
                false,
127
                false,
128
                false,
129
                false,
130
                null,
131
                null,
132
            ],
133
            $queueBag->getExchangeDeclare()
134
        );
135
    }
136
137 View Code Duplication
    public function testBadTypeInGetExchangeDeclare()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
138
    {
139
        $queueBag = new SubscriberQueueBag('test', ExchangeType::DIRECT);
140
141
        $this->assertNotEquals(
142
            [
143
                'test',
144
                ExchangeType::FANOUT,
145
                false,
146
                false,
147
                false,
148
                false,
149
                false,
150
                false,
151
                null,
152
                null,
153
            ],
154
            $queueBag->getExchangeDeclare()
155
        );
156
    }
157
}
158