Code Duplication    Length = 44-45 lines in 2 locations

test/CommandBus/Repository/LatestMessageTest.php 1 location

@@ 32-76 (lines=45) @@
29
 * Class LatestMessageTest
30
 * @author Gabriel Somoza <[email protected]>
31
 */
32
class LatestMessageTest extends MessageTestCase
33
{
34
35
    /**
36
     * testConstructor
37
     */
38
    public function testConstructor()
39
    {
40
        $instance = new LatestMessage();
41
        $this->assertInstanceOf(AbstractRepositoryMessage::class, $instance);
42
    }
43
44
    /**
45
     * getClassName must return a string with the FQN of the command class being tested
46
     * @return string
47
     */
48
    protected function getClassName()
49
    {
50
        return LatestMessage::class;
51
    }
52
53
    /**
54
     * Must return an array in the format:
55
     *
56
     *      [
57
     *          'name' => 'functionName', // required
58
     *          'with' => [arguments for with] // optional
59
     *          'return' => return value // optional, defaults to return self
60
     *          'times' => number of times it will be invoked
61
     *      ]
62
     *
63
     * @return array
64
     */
65
    protected function getExpectations()
66
    {
67
        return [
68
            [   'name' => 'setName',
69
                'with' => 'migrations:latest',
70
            ],
71
            [   'name' => 'setDescription',
72
                'with' => m::type('string'),
73
            ],
74
        ];
75
    }
76
}
77

test/CommandBus/Storage/LatestMessageTest.php 1 location

@@ 31-74 (lines=44) @@
28
 * Class LatestMessageTest
29
 * @author Gabriel Somoza <[email protected]>
30
 */
31
class LatestMessageTest extends MessageTestCase
32
{
33
    /**
34
     * testConstructor
35
     */
36
    public function testConstructor()
37
    {
38
        $instance = new LatestMessage();
39
        $this->assertInstanceOf(AbstractStorageMessage::class, $instance);
40
    }
41
42
    /**
43
     * getClassName must return a string with the FQN of the command class being tested
44
     * @return string
45
     */
46
    protected function getClassName()
47
    {
48
        return LatestMessage::class;
49
    }
50
51
    /**
52
     * Must return an array in the format:
53
     *
54
     *      [
55
     *          'name' => 'functionName', // required
56
     *          'with' => [arguments for with] // optional
57
     *          'return' => return value // optional, defaults to return self
58
     *          'times' => number of times it will be invoked
59
     *      ]
60
     *
61
     * @return array
62
     */
63
    protected function getExpectations()
64
    {
65
        return [
66
            [   'name' => 'setName',
67
                'with' => 'storage:latest',
68
            ],
69
            [   'name' => 'setDescription',
70
                'with' => m::type('string'),
71
            ],
72
        ];
73
    }
74
}
75