Code Duplication    Length = 8-10 lines in 10 locations

lib/custom/tests/MW/Filesystem/LaravelTest.php 10 locations

@@ 58-65 (lines=8) @@
55
	}
56
57
58
	public function testMkdirException()
59
	{
60
		$this->mock->expects( $this->once() )->method( 'makeDirectory' )
61
			->will( $this->throwException( new \Exception() ) );
62
63
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
64
		$this->object->mkdir( 'test' );
65
	}
66
67
68
	public function testRmdir()
@@ 76-83 (lines=8) @@
73
	}
74
75
76
	public function testRmdirException()
77
	{
78
		$this->mock->expects( $this->once() )->method( 'deleteDirectory' )
79
			->will( $this->throwException( new \Exception() ) );
80
81
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
82
		$this->object->rmdir( 'test' );
83
	}
84
85
86
	public function testScan()
@@ 106-113 (lines=8) @@
103
	}
104
105
106
	public function testScanException()
107
	{
108
		$this->mock->expects( $this->once() )->method( 'directories' )
109
			->will( $this->throwException( new \Exception() ) );
110
111
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
112
		$this->object->scan( 'test' );
113
	}
114
115
116
	public function testSize()
@@ 127-134 (lines=8) @@
124
	}
125
126
127
	public function testSizeException()
128
	{
129
		$this->mock->expects( $this->once() )->method( 'size' )
130
			->will( $this->throwException( new \Exception() ) );
131
132
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
133
		$this->object->size( 'test' );
134
	}
135
136
137
	public function testTime()
@@ 148-155 (lines=8) @@
145
	}
146
147
148
	public function testTimeException()
149
	{
150
		$this->mock->expects( $this->once() )->method( 'lastModified' )
151
			->will( $this->throwException( new \Exception() ) );
152
153
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
154
		$this->object->time( 'test' );
155
	}
156
157
158
	public function testRm()
@@ 166-173 (lines=8) @@
163
	}
164
165
166
	public function testRmException()
167
	{
168
		$this->mock->expects( $this->once() )->method( 'delete' )
169
			->will( $this->throwException( new \Exception() ) );
170
171
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
172
		$this->object->rm( 'test' );
173
	}
174
175
176
	public function testHas()
@@ 263-270 (lines=8) @@
260
	}
261
262
263
	public function testWriteException()
264
	{
265
		$this->mock->expects( $this->once() )->method( 'put' )
266
			->will( $this->throwException( new \Exception() ) );
267
268
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
269
		$this->object->write( '', 'test' );
270
	}
271
272
273
	public function testWritef()
@@ 305-314 (lines=10) @@
302
	}
303
304
305
	public function testWritesException()
306
	{
307
		$this->mock->expects( $this->once() )->method( 'put' )
308
			->will( $this->throwException( new \Exception() ) );
309
310
		$handle = fopen( __FILE__, 'r' );
311
312
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
313
		$this->object->writes( 'file', $handle );
314
	}
315
316
317
	public function testWritesException2()
@@ 332-339 (lines=8) @@
329
	}
330
331
332
	public function testMoveException()
333
	{
334
		$this->mock->expects( $this->once() )->method( 'move' )
335
			->will( $this->throwException( new \Exception() ) );
336
337
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
338
		$this->object->move( 'file1', 'file2' );
339
	}
340
341
342
	public function testCopy()
@@ 350-357 (lines=8) @@
347
	}
348
349
350
	public function testCopyException()
351
	{
352
		$this->mock->expects( $this->once() )->method( 'copy' )
353
			->will( $this->throwException( new \Exception() ) );
354
355
		$this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' );
356
		$this->object->copy( 'file1', 'file2' );
357
	}
358
}
359