Completed
Push — 1.x ( 48ee65 )
by Joel
08:21
created

ContainerManagerTest::testWait()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4286
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Docker\Tests\Manager;
4
5
use Docker\API\Model\Container;
6
use Docker\Context\ContextBuilder;
7
use Docker\Tests\TestCase;
8
9
class ContainerManagerTest extends TestCase
10
{
11
    /**
12
     * Return the container manager
13
     *
14
     * @return \Docker\API\Resource\ContainerResource
15
     */
16
    private function getManager()
17
    {
18
        return $this->getDocker()->getContainerManager();
19
    }
20
21
    public function testFindAll()
22
    {
23
        $container = new Container();
24
        $container->setImage('ubuntu:precise');
25
26
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '1')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
Unused Code introduced by
$container is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
27
28
        $manager = $this->getManager();
29
30
        $this->assertInternalType('array', $manager->findAll());
0 ignored issues
show
Bug introduced by
The method findAll() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
    }
32
33
    public function testCreate()
34
    {
35
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
36
37
        $manager = $this->getManager();
38
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
39
40
        $this->assertNotEmpty($container->getId());
41
    }
42
43
    public function testInteract()
44
    {
45
        $container = new Container([
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...=> true, 'Tty' => true).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
46
            'Image' => 'ubuntu:precise',
47
            'Cmd'   => ['/bin/bash'],
48
            'AttachStdin'  => false,
49
            'AttachStdout' => true,
50
            'AttachStderr' => true,
51
            'OpenStdin'    => true,
52
            'Tty'          => true,
53
        ]);
54
55
        $manager = $this->getManager();
56
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
57
        $stream = $manager->interact($container);
0 ignored issues
show
Bug introduced by
The method interact() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
58
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
59
60
        $this->assertNotEmpty($container->getId());
61
        $this->assertInstanceOf('\Docker\Http\Stream\InteractiveStream', $stream);
62
63
        stream_set_blocking($stream->getSocket(), 0);
64
65
        $read   = [$stream->getSocket()];
66
        $write  = null;
67
        $expect = null;
68
69
        $stream->write("echo test\n");
70
        $data = "";
71
        do {
72
            $frame = $stream->receive(true);
73
            $data .= $frame['data'];
74
        } while (stream_select($read, $write, $expect, 1) > 0);
75
76
        $manager->stop($container, 1);
0 ignored issues
show
Bug introduced by
The method stop() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
77
78
        $this->assertRegExp('#root@'.substr($container->getId(), 0, 12).':/\# echo test#', $data, $data);
79
    }
80
81
    public function testCreateThrowsRightFormedException()
82
    {
83
        $container = new Container(['Image' => 'non-existent']);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'non-existent').

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
84
85
        $manager = $this->getManager();
86
87
        try {
88
            $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
89
        } catch (\GuzzleHttp\Exception\RequestException $e) {
0 ignored issues
show
Bug introduced by
The class GuzzleHttp\Exception\RequestException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
90
            $this->assertTrue($e->hasResponse());
91
            $this->assertEquals("404", $e->getResponse()->getStatusCode());
92
            $this->assertContains('No such image', $e->getMessage());
93
        }
94
    }
95
96 View Code Duplication
    public function testStart()
0 ignored issues
show
Duplication introduced by
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...
97
    {
98
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
99
100
        $manager = $this->getManager();
101
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
102
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
103
104
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
105
106
        $this->assertEquals(0, $runtimeInformations['State']['ExitCode']);
107
    }
108
109
    public function testRunDefault()
110
    {
111
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
112
        $manager = $this
113
            ->getMockBuilder('\Docker\Manager\ContainerManager')
114
            ->setMethods(['create', 'start', 'wait'])
115
            ->disableOriginalConstructor()
116
            ->getMock();
117
118
        $container->setExitCode(0);
0 ignored issues
show
Bug introduced by
The method setExitCode() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
119
120
        $manager->expects($this->once())
121
            ->method('create')
122
            ->with($this->isInstanceOf('\Docker\Container'))
123
            ->will($this->returnSelf());
124
125
        $manager->expects($this->once())
126
            ->method('start')
127
            ->with($this->isInstanceOf('\Docker\Container'))
128
            ->will($this->returnSelf());
129
130
        $manager->expects($this->once())
131
            ->method('wait')
132
            ->with($this->isInstanceOf('\Docker\Container'))
133
            ->will($this->returnSelf());
134
135
        $this->assertTrue($manager->run($container));
136
    }
137
138
    public function testRunAttach()
139
    {
140
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
141
        $manager = $this
142
            ->getMockBuilder('\Docker\Manager\ContainerManager')
143
            ->setMethods(['create', 'start', 'wait', 'attach'])
144
            ->disableOriginalConstructor()
145
            ->getMock();
146
147
        $response = $this->getMockBuilder('\GuzzleHttp\Message\Response')->disableOriginalConstructor()->getMock();
148
        $stream   = $this->getMockBuilder('\GuzzleHttp\Stream\Stream')->disableOriginalConstructor()->getMock();
149
150
        $container->setExitCode(0);
0 ignored issues
show
Bug introduced by
The method setExitCode() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
151
        $callback = function () {};
152
153
        $manager->expects($this->once())
154
            ->method('create')
155
            ->with($this->isInstanceOf('\Docker\Container'))
156
            ->will($this->returnSelf());
157
158
        $manager->expects($this->once())
159
            ->method('attach')
160
            ->with($this->isInstanceOf('\Docker\Container'), $this->equalTo($callback), $this->equalTo(true), $this->equalTo(true), $this->equalTo(true), $this->equalTo(true), $this->equalTo(true), $this->equalTo(null))
161
            ->will($this->returnValue($response));
162
163
        $manager->expects($this->once())
164
            ->method('start')
165
            ->with($this->isInstanceOf('\Docker\Container'))
166
            ->will($this->returnSelf());
167
168
        $response->expects($this->once())
169
            ->method('getBody')
170
            ->will($this->returnValue($stream));
171
172
        $manager->expects($this->once())
173
            ->method('wait')
174
            ->with($this->isInstanceOf('\Docker\Container'))
175
            ->will($this->returnSelf());
176
177
        $this->assertTrue($manager->run($container, $callback));
178
    }
179
180
    public function testRunDaemon()
181
    {
182
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
183
        $manager = $this
184
            ->getMockBuilder('\Docker\Manager\ContainerManager')
185
            ->setMethods(['create', 'start', 'wait'])
186
            ->disableOriginalConstructor()
187
            ->getMock();
188
189
        $container->setExitCode(0);
0 ignored issues
show
Bug introduced by
The method setExitCode() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
190
191
        $manager->expects($this->once())
192
            ->method('create')
193
            ->with($this->isInstanceOf('\Docker\Container'))
194
            ->will($this->returnSelf());
195
196
        $manager->expects($this->once())
197
            ->method('start')
198
            ->with($this->isInstanceOf('\Docker\Container'))
199
            ->will($this->returnSelf());
200
201
        $manager->expects($this->never())
202
            ->method('wait');
203
204
        $this->assertNull($manager->run($container, null, [], true));
205
    }
206
207 View Code Duplication
    public function testAttach()
0 ignored issues
show
Duplication introduced by
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...
208
    {
209
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/bash', '-c', 'echo -n "output"']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...', 'echo -n "output"')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
210
        $manager = $this->getManager();
211
212
        $type   = 0;
213
        $output = "";
214
215
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
216
        $response = $manager->attach($container, function ($log, $stdtype) use (&$type, &$output) {
0 ignored issues
show
Bug introduced by
The method attach() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean attachContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
217
            $type = $stdtype;
218
            $output = $log;
219
        });
220
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
221
222
        $response->getBody()->getContents();
223
224
        $this->assertEquals(1, $type);
225
        $this->assertEquals('output', $output);
226
    }
227
228 View Code Duplication
    public function testAttachStderr()
0 ignored issues
show
Duplication introduced by
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...
229
    {
230
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/bash', '-c', 'echo -n "error" 1>&2']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...echo -n "error" 1>&2')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
231
        $manager = $this->getManager();
232
233
        $type   = 0;
234
        $output = "";
235
236
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
237
        $response = $manager->attach($container, function ($log, $stdtype) use (&$type, &$output) {
0 ignored issues
show
Bug introduced by
The method attach() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean attachContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
238
            $type = $stdtype;
239
            $output = $log;
240
        });
241
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
242
243
        $response->getBody()->getContents();
244
245
        $this->assertEquals(2, $type);
246
        $this->assertEquals('error', $output);
247
    }
248
249
    /**
250
     * Not sure how to reliably test that we actually waited for the container
251
     * but this should at least ensure no exception is thrown
252
     */
253 View Code Duplication
    public function testWait()
0 ignored issues
show
Duplication introduced by
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...
254
    {
255
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '1')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
256
257
        $manager = $this->getManager();
258
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
259
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
260
261
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
262
263
        $this->assertEquals(0, $runtimeInformations['State']['ExitCode']);
264
    }
265
266
    /**
267
     * @expectedException GuzzleHttp\Exception\RequestException
268
     */
269 View Code Duplication
    public function testWaitWithTimeout()
0 ignored issues
show
Duplication introduced by
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...
270
    {
271
        if (getenv('DOCKER_TLS_VERIFY')) {
272
            $this->markTestSkipped('This test failed when using ssl due to this bug : https://bugs.php.net/bug.php?id=41631');
273
        }
274
275
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '2']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '2')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
276
277
        $manager = $this->getManager();
278
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
279
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
280
        $manager->wait($container, 1);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
281
    }
282
283 View Code Duplication
    public function testTimeoutExceptionHasRequest()
0 ignored issues
show
Duplication introduced by
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...
284
    {
285
        if (getenv('DOCKER_TLS_VERIFY')) {
286
            $this->markTestSkipped('This test failed when using ssl due to this bug : https://bugs.php.net/bug.php?id=41631');
287
        }
288
289
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '2']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '2')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
290
291
        $manager = $this->getManager();
292
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
293
294
        try {
295
            $manager->wait($container, 1);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
296
        } catch (RequestException $e) {
0 ignored issues
show
Bug introduced by
The class Docker\Tests\Manager\RequestException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
297
            $this->assertInstanceOf('Docker\\Http\\Request', $e->getRequest());
298
        }
299
    }
300
301 View Code Duplication
    public function testExposeFixedPort()
0 ignored issues
show
Duplication introduced by
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...
302
    {
303
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '1')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
304
305
        $port = new Port('8888:80/tcp');
306
307
        $container->setExposedPorts($port);
0 ignored issues
show
Bug introduced by
The method setExposedPorts() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
308
309
        $manager = $this->getManager();
310
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
311
        $manager->start($container, ['PortBindings' => $port->toSpec()]);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
312
313
        $this->assertEquals(8888, $container->getMappedPort(80)->getHostPort());
0 ignored issues
show
Bug introduced by
The method getMappedPort() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
314
    }
315
316 View Code Duplication
    public function testExposeRandomPort()
0 ignored issues
show
Duplication introduced by
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...
317
    {
318
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '1')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
319
320
        $port = new Port('80/tcp');
321
        $container->setExposedPorts($port);
0 ignored issues
show
Bug introduced by
The method setExposedPorts() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
322
323
        $manager = $this->getManager();
324
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
325
        $manager->start($container, ['PortBindings' => $port->toSpec()]);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
326
327
        $this->assertInternalType('integer', $container->getMappedPort(80)->getHostPort());
0 ignored issues
show
Bug introduced by
The method getMappedPort() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
328
    }
329
330
    public function testInspect()
331
    {
332
        $manager = $this->getManager();
333
334
        $this->assertEquals(null, $manager->find('foo'));
0 ignored issues
show
Bug introduced by
The method find() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
335
336
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
337
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
338
339
        $this->assertInstanceOf('Docker\\Container', $manager->find($container->getId()));
0 ignored issues
show
Bug introduced by
The method find() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
340
    }
341
342
    public function testRemove()
343
    {
344
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['date']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...'Cmd' => array('date')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
345
346
        $manager = $this->getManager();
347
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
348
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
349
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
350
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
351
352
        $this->setExpectedException('\\Docker\\Exception\\ContainerNotFoundException', 'Container not found');
353
        $manager->inspect($container);
0 ignored issues
show
Bug introduced by
The method inspect() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
354
    }
355
    
356
    public function testForceRemove()
357
    {
358
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['tail', '-f', '/var/log/lastlog']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...', '/var/log/lastlog')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
359
360
        $manager = $this->getManager();
361
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
362
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
363
364
        try {
365
            $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
366
            $this->assertTrue(false);
367
        } catch (APIException $e) {
0 ignored issues
show
Bug introduced by
The class Docker\Tests\Manager\APIException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
368
            $this->assertTrue(true);
369
        }
370
371
        $manager->remove($container, false, true);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
372
373
        try {
374
            $manager->inspect($container);
0 ignored issues
show
Bug introduced by
The method inspect() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
375
            $this->assertTrue(false);
376
        } catch (ContainerNotFoundException $e) {
0 ignored issues
show
Bug introduced by
The class Docker\Tests\Manager\ContainerNotFoundException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
377
            $this->assertTrue(true);
378
        }
379
    }
380
381
    public function testRemoveContainers()
382
    {
383
        $containers = ['3360ea744df2', 'a412d121d015'];
384
        $manager = $this
385
            ->getMockBuilder('\Docker\Manager\ContainerManager')
386
            ->setMethods(['remove'])
387
            ->disableOriginalConstructor()
388
            ->getMock();
389
390
        $manager->expects($this->exactly(2))
391
            ->method('remove')
392
            ->with($this->isInstanceOf('\Docker\Container'), false)
393
            ->will($this->returnSelf());
394
395
        $manager->removeContainers($containers);
396
    }
397
    
398 View Code Duplication
    public function testForceRemoveContainers()
0 ignored issues
show
Duplication introduced by
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...
399
    {
400
        $containers = ['3360ea744df2', 'a412d121d015'];
401
        $manager = $this
402
            ->getMockBuilder('\Docker\Manager\ContainerManager')
403
            ->setMethods(['remove'])
404
            ->disableOriginalConstructor()
405
            ->getMock();
406
407
        $manager->expects($this->exactly(2))
408
            ->method('remove')
409
            ->with($this->isInstanceOf('\Docker\Container'), false, true)
410
            ->will($this->returnSelf());
411
412
        $manager->removeContainers($containers, false, true);
413
    }
414
415
    public function testTop()
416
    {
417
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['sleep', '5']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...=> array('sleep', '5')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
418
        $manager = $this->getManager();
419
        $manager->run($container, null, [], true);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
420
421
        sleep(1);
422
423
        $processes = $manager->top($container);
0 ignored issues
show
Bug introduced by
The method top() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
424
425
        $this->assertCount(1, $processes);
426
        $this->assertArrayHasKey('COMMAND', $processes[0]);
427
        $this->assertEquals('sleep 5', $processes[0]['COMMAND']);
428
429
        $manager->kill($container);
0 ignored issues
show
Bug introduced by
The method kill() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
430
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
431
    }
432
433
    public function testChanges()
434
    {
435
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['touch', '/docker-php-test']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...', '/docker-php-test')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
436
        $manager = $this->getManager();
437
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
438
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
439
440
        $changes = $manager->changes($container);
0 ignored issues
show
Bug introduced by
The method changes() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean getContainerChanges()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
441
442
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
443
444
        $this->assertCount(1, $changes);
445
        $this->assertEquals('/docker-php-test', $changes[0]['Path']);
446
        $this->assertEquals(1, $changes[0]['Kind']);
447
    }
448
449
    public function testExport()
450
    {
451
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['touch', '/docker-php-test']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...', '/docker-php-test')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
452
        $manager = $this->getManager();
453
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
454
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
455
456
        $exportStream = $manager->export($container);
0 ignored issues
show
Bug introduced by
The method export() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean exportContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
457
458
        $this->assertInstanceOf('\GuzzleHttp\Stream\Stream', $exportStream);
459
460
        $tarFileName  = tempnam(sys_get_temp_dir(), 'docker-php-export-test-');
461
        $tarFile      = fopen($tarFileName, 'w+');
462
463
        stream_copy_to_stream($exportStream->detach(), $tarFile);
464
        fclose($tarFile);
465
466
        exec('/usr/bin/env tar -tf '.$tarFileName, $output);
467
468
        $this->assertContains('docker-php-test', $output);
469
        $this->assertContains('.dockerinit', $output);
470
471
        unlink($tarFileName);
472
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
473
    }
474
475
    public function testCopyToDisk()
476
    {
477
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['touch', '/etc/default/docker-php-test']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ault/docker-php-test')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
478
        $manager = $this->getManager();
479
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
480
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
481
482
        $tarFileName  = tempnam(sys_get_temp_dir(), 'testcopyToDisk.tar');
483
        $manager->copyToDisk($container, '/etc/default', $tarFileName);
0 ignored issues
show
Bug introduced by
The method copyToDisk() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
484
485
        exec('/usr/bin/env tar -tf '.$tarFileName, $output);
486
        $this->assertContains('default/docker-php-test', $output);
487
488
        unlink($tarFileName);
489
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
490
    }
491
492
    public function testLogs()
493
    {
494
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['echo', 'test']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... array('echo', 'test')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
495
        $manager = $this->getManager();
496
        $manager->run($container);
0 ignored issues
show
Bug introduced by
The method run() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
497
        $manager->stop($container);
0 ignored issues
show
Bug introduced by
The method stop() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
498
        $logs = $manager->logs($container, false, true);
0 ignored issues
show
Bug introduced by
The method logs() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
499
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
500
501
        $this->assertGreaterThanOrEqual(1, count($logs));
502
503
        $logs = array_map(function ($value) {
504
            return $value['output'];
505
        }, $logs);
506
507
        $this->assertContains("test", implode("", $logs));
508
    }
509
510
    public function testRestart()
511
    {
512
        $manager = $this->getManager();
513
514
        $container = new Container(['Image' => 'busybox', 'Cmd' => ['sleep', '10']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'busybo...> array('sleep', '10')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
515
516
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
517
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
518
        $this->assertEquals('0001-01-01T00:00:00Z', $container->getRuntimeInformations()['State']['FinishedAt']);
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
519
520
        $manager->restart($container);
0 ignored issues
show
Bug introduced by
The method restart() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean restartContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
521
        $this->assertNotEquals('0001-01-01T00:00:00Z', $container->getRuntimeInformations()['State']['FinishedAt']);
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
522
523
        $manager->stop($container);
0 ignored issues
show
Bug introduced by
The method stop() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
524
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
525
    }
526
527
    public function testKill()
528
    {
529
        $manager = $this->getManager();
530
        $dockerFileBuilder = new ContextBuilder();
531
        $dockerFileBuilder->from('ubuntu:precise');
532
        $dockerFileBuilder->add('/kill.sh', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'script' . DIRECTORY_SEPARATOR . 'kill.sh'));
533
        $dockerFileBuilder->run('chmod +x /kill.sh');
534
535
        $this->getDocker()->build($dockerFileBuilder->getContext(), 'docker-php-kill-test', null, true, false, true);
536
537
        $container = new Container(['Image' => 'docker-php-kill-test:latest', 'Cmd' => ['/kill.sh']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'docker...' => array('/kill.sh')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
538
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
539
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
540
        $manager->kill($container, "SIGHUP");
0 ignored issues
show
Bug introduced by
The method kill() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
541
        $manager->wait($container);
0 ignored issues
show
Bug introduced by
The method wait() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
542
543
        $logs = $manager->logs($container, false, true);
0 ignored issues
show
Bug introduced by
The method logs() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
544
        $logs = array_map(function ($value) {
545
            return $value['output'];
546
        }, $logs);
547
548
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
549
        $this->getDocker()->getImageManager()->remove($container->getImage());
550
551
        $this->assertContains('HUP', implode("", $logs));
552
    }
553
554
    public function testExec()
555
    {
556
        $manager = $this->getManager();
557
        $dockerFileBuilder = new ContextBuilder();
558
        $dockerFileBuilder->from('ubuntu:precise');
559
        $dockerFileBuilder->add('/daemon.sh', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'script' . DIRECTORY_SEPARATOR . 'daemon.sh'));
560
        $dockerFileBuilder->run('chmod +x /daemon.sh');
561
562
        $this->getDocker()->build($dockerFileBuilder->getContext(), 'docker-php-restart-test', null, true, false, true);
563
564
        $container = new Container(['Image' => 'docker-php-restart-test', 'Cmd' => ['/daemon.sh']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'docker...=> array('/daemon.sh')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
565
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
566
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
567
568
        $type   = 0;
569
        $output = "";
570
        $execId = $manager->exec($container, ['/bin/bash', '-c', 'echo -n "output"']);
0 ignored issues
show
Bug introduced by
The method exec() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
571
572
        $this->assertNotNull($execId);
573
574
        $response = $manager->execstart($execId, function ($log, $stdtype) use (&$type, &$output) {
0 ignored issues
show
Bug introduced by
The method execstart() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
575
            $type = $stdtype;
576
            $output = $log;
577
        });
578
579
        $response->getBody()->getContents();
580
581
        $manager->kill($container);
0 ignored issues
show
Bug introduced by
The method kill() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
582
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
583
584
        $this->assertEquals(1, $type);
585
        $this->assertEquals('output', $output);
586
    }
587
588
    public function testExecInspect()
589
    {
590
        $manager = $this->getManager();
591
        $dockerFileBuilder = new ContextBuilder();
592
        $dockerFileBuilder->from('ubuntu:precise');
593
        $dockerFileBuilder->add('/daemon.sh', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'script' . DIRECTORY_SEPARATOR . 'daemon.sh'));
594
        $dockerFileBuilder->run('chmod +x /daemon.sh');
595
596
        $this->getDocker()->build($dockerFileBuilder->getContext(), 'docker-php-restart-test', null, true, false, true);
597
598
        $container = new Container(['Image' => 'docker-php-restart-test', 'Cmd' => ['/daemon.sh']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'docker...=> array('/daemon.sh')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
599
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
600
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
601
602
        $execId = $manager->exec($container, ['/bin/bash', '-c', 'echo -n "output"']);
0 ignored issues
show
Bug introduced by
The method exec() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
603
        $inspection = $manager->execinspect($execId);
0 ignored issues
show
Bug introduced by
The method execinspect() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
604
605
        $this->assertEquals(0, $inspection->ExitCode);
606
        $this->assertEquals(false, $inspection->Running);
607
    }
608
609
    public function testRename()
610
    {
611
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/true']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu... => array('/bin/true')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
612
613
        $manager = $this->getManager();
614
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
615
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
616
        $manager->rename($container, 'FoobarRenamed');
0 ignored issues
show
Bug introduced by
The method rename() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean renameContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
617
618
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Unused Code introduced by
$runtimeInformations is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
619
		
620
        $this->assertInstanceOf('Docker\\Container', $manager->find('FoobarRenamed'));
0 ignored issues
show
Bug introduced by
The method find() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
621
        $manager->stop($container);   // cleanup
0 ignored issues
show
Bug introduced by
The method stop() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
622
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
623
    }
624
625
    public function testPause()
626
    {
627
        $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]);
0 ignored issues
show
Unused Code introduced by
The call to Container::__construct() has too many arguments starting with array('Image' => 'ubuntu...ray('/bin/sleep', '1')).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
628
629
        $manager = $this->getManager();
630
        $manager->create($container);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean createContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
631
        $manager->start($container);
0 ignored issues
show
Bug introduced by
The method start() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
632
633
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
634
        $this->assertEquals(false, $runtimeInformations['State']['Paused']);
635
        $this->assertEquals(true, $runtimeInformations['State']['Running']);
636
637
        $manager->pause($container);
0 ignored issues
show
Bug introduced by
The method pause() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
638
639
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
640
        $this->assertEquals(true, $runtimeInformations['State']['Paused']);
641
        $this->assertEquals(true, $runtimeInformations['State']['Running']);
642
643
        $manager->unpause($container);
0 ignored issues
show
Bug introduced by
The method unpause() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean unpauseContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
644
645
        $runtimeInformations = $container->getRuntimeInformations();
0 ignored issues
show
Bug introduced by
The method getRuntimeInformations() does not seem to exist on object<Docker\API\Model\Container>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
646
        $this->assertEquals(false, $runtimeInformations['State']['Paused']);
647
        $this->assertEquals(true, $runtimeInformations['State']['Running']);
648
649
        // cleanup
650
        $manager->stop($container);
0 ignored issues
show
Bug introduced by
The method stop() does not seem to exist on object<Docker\API\Resource\ContainerResource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
651
        $manager->remove($container);
0 ignored issues
show
Bug introduced by
The method remove() does not exist on Docker\API\Resource\ContainerResource. Did you maybe mean removeContainer()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
652
    }
653
654
}
655