Issues (33)

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/units/ReadOnlyFallbackAdapter.php (32 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 tests\units\BePark\Flysystem\ReadOnlyFallback;
4
5
use League\Flysystem\AdapterInterface;
6
use League\Flysystem\Config;
7
8
class ReadOnlyFallbackAdapter extends \atoum\test
9
{
10
	public function testAdapters(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
11
	{
12
		$this
13
			->given($this->newTestedInstance($mainAdapter, $readOnlyAdapter))
14
			->then
15
				->object($this->testedInstance->getMainAdapter())->isIdenticalTo($mainAdapter)
16
				->object($this->testedInstance->getReadOnlyAdapter())->isIdenticalTo($readOnlyAdapter);
17
	}
18
19
	public function testHasPath(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
20
	{
21
		$this
22
			->assert('test path existence on readOnly')
23
			->given(
24
				$this->newTestedInstance($mainAdapter, $readOnlyAdapter),
25
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
26
				$this->calling($mainAdapter)->has = false
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
27
			)
28
			->then
29
				->boolean($this->testedInstance->has('/foo'))->isTrue
30
				->mock($readOnlyAdapter)->receive('has')->withIdenticalArguments('/foo')->once
31
				->mock($mainAdapter)->receive('has')->withIdenticalArguments('/foo')->once;
32
33
		$this
34
			->assert('test path existence on mainAdapter')
35
			->given($this->calling($mainAdapter)->has = true,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
36
					$this->calling($readOnlyAdapter)->has = false)
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
37
			->then
38
				->boolean($this->testedInstance->has('/foo'))->isTrue
39
				->mock($mainAdapter)->receive('has')->withIdenticalArguments('/foo')->once
40
				->mock($readOnlyAdapter)->call('has')->never;
41
42
43
		$this
44
			->assert('test none existing path')
45
			->given($this->calling($mainAdapter)->has = false,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
46
					$this->calling($readOnlyAdapter)->has = false)
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
47
			->then
48
				->boolean($this->testedInstance->has('/foo'))->isFalse
49
				->mock($mainAdapter)->receive('has')->withIdenticalArguments('/foo')->once
50
				->mock($readOnlyAdapter)->receive('has')->withIdenticalArguments('/foo')->once;
51
	}
52
53
	public function testWriteAndWriteStream(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
54
	{
55
		$this->calling($mainAdapter)->write = true;
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
56
		$this->calling($readOnlyAdapter)->write = false;
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
57
58
		$this->calling($mainAdapter)->writeStream = true;
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
59
		$this->calling($readOnlyAdapter)->writeStream = false;
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
60
61
		$this
62
			->assert('test write')
63
			->given($this->newTestedInstance($mainAdapter, $readOnlyAdapter))
64
			->then
65
			->boolean($this->testedInstance->write('/foo', 'bar', new Config()))->isTrue
66
				->mock($readOnlyAdapter)->wasNotCalled
67
				->mock($mainAdapter)->receive('write')->withAtLeastArguments(['/foo', 'bar'])->once;
68
69
		$this
70
			->assert('test write stream')
71
			->given($this->newTestedInstance($mainAdapter, $readOnlyAdapter))
72
			->then
73
			->boolean($this->testedInstance->writeStream('/foo', 'bar', new Config()))->isTrue
74
				->mock($readOnlyAdapter)->wasNotCalled
75
				->mock($mainAdapter)->receive('writeStream')->withAtLeastArguments(['/foo', 'bar'])->once;
76
	}
77
78
	public function testUpdate(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
79
	{
80
		$this
81
			->assert('test update only on main if exist on main')
82
			->given(
83
				$this->newTestedInstance($mainAdapter, $readOnlyAdapter),
84
				$this->calling($mainAdapter)->has = true,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
85
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
86
				$this->calling($mainAdapter)->update = true
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
87
			)
88
			->then
89
				->boolean($this->testedInstance->update('/foo', 'bar', new Config()))->isTrue
90
				->mock($readOnlyAdapter)->wasNotCalled
91
				->mock($mainAdapter)->receive('update')->withAtLeastArguments(['/foo', 'bar'])->once;
92
93
		$this
94
			->assert('test update only on main but not exist on main')
95
			->given(
96
				$this->calling($mainAdapter)->has = false,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
97
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
98
				$this->calling($mainAdapter)->update = true
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
99
			)
100
			->then
101
			->boolean($this->testedInstance->update('/foo', 'bar', new Config()))->isTrue
102
			->mock($readOnlyAdapter)->call('update')->never
103
			->mock($mainAdapter)->receive('update')->withAtLeastArguments(['/foo', 'bar'])->once;
104
	}
105
106
	public function testDelete(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
107
	{
108
		$this->newTestedInstance($mainAdapter, $readOnlyAdapter);
109
110
		$this->assert('test delete on non existing on main')
111
			->given(
112
				$this->calling($mainAdapter)->has = false,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
113
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
114
				$this->calling($mainAdapter)->delete = true
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
115
			)
116
			->boolean($this->testedInstance->delete('foo/bar'))->isTrue
117
			->mock($mainAdapter)->receive('delete')->never
118
			->mock($readOnlyAdapter)->receive('delete')->never;
119
120
		$this->assert('test delete on existing on main')
121
			->given(
122
				$this->calling($mainAdapter)->has = true,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
123
				$this->calling($mainAdapter)->delete = true
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
124
			)
125
			->boolean($this->testedInstance->delete('foo/bar'))->isTrue
126
			->mock($mainAdapter)->receive('delete')->withIdenticalArguments('foo/bar')->once;
127
	}
128
129
	public function testRead(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
130
	{
131
		$this->newTestedInstance($mainAdapter, $readOnlyAdapter);
132
		$this->assert('test read on existing on main')
133
			->given(
134
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
135
				$this->calling($mainAdapter)->has = true,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
136
				$this->calling($mainAdapter)->read = 'foo'
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
137
			)
138
			->string($this->testedInstance->read('foo/bar'))->isEqualTo('foo')
139
			->mock($readOnlyAdapter)->wasNotCalled;
140
141
		$this->assert('test read on existing only on read only')
142
			->given(
143
				$this->calling($readOnlyAdapter)->has = true,
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
144
				$this->calling($mainAdapter)->has = false,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
145
				$this->calling($readOnlyAdapter)->read = 'baz',
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
146
				$this->calling($mainAdapter)->read = false
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
147
			)
148
			->string($this->testedInstance->read('foo/bar'))->isEqualTo('baz');
149
	}
150
151
	public function testGetMetadata(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
152
	{
153
		$this->given(
154
			$this->newTestedInstance($mainAdapter, $readOnlyAdapter),
155
			$this->calling($mainAdapter)->has = true,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
156
			$this->calling($mainAdapter)->getMetadata = array('metadata')
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
157
		)
158
		->then
159
			->array($this->testedInstance->getMetadata('foo'))->isEqualTo(['metadata'])
160
			->mock($readOnlyAdapter)->wasNotCalled
161
			->mock($mainAdapter)->receive('getMetadata')->once;
162
	}
163
164
	public function testListContent(AdapterInterface $mainAdapter, AdapterInterface $readOnlyAdapter)
165
	{
166
		$a = [
167
			[
168
				'type' => 'file',
169
				'path' => 'foo',
170
				'size' => 0,
171
				'timestamp' => time(),
172
			],
173
			[
174
				'type' => 'file',
175
				'path' => 'bar',
176
				'size' => 100,
177
				'timestamp' => time() - 100,
178
			],
179
			[
180
				'type' => 'dir',
181
				'path' => 'baz',
182
				'size' => 0,
183
				'timestamp' => time() - 200,
184
			],
185
	    ];
186
187
		$b = [
188
			[
189
				'type' => 'file',
190
				'path' => 'foo',
191
				'size' => 10,
192
				'timestamp' => time(),
193
			],
194
			[
195
				'type' => 'file',
196
				'path' => 'baz',
197
				'size' => 150,
198
				'timestamp' => time() - 150,
199
			]
200
		];
201
202
		$this->given(
203
			$this->newTestedInstance($mainAdapter, $readOnlyAdapter),
204
			$this->calling($mainAdapter)->listContents = $a,
0 ignored issues
show
$mainAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
205
			$this->calling($readOnlyAdapter)->listContents = $a
0 ignored issues
show
$readOnlyAdapter is of type object<League\Flysystem\AdapterInterface>, but the function expects a object<mageekguy\atoum\mock\aggregator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
206
		)
207
		->then
208
			->array($this->testedInstance->listContents())
209
				->isIdenticalTo($a + $b);
210
	}
211
}
212