Lines Matching +full:n +full:- +full:one

15  * Tests CLI-related methods for the structtasks plugin
28 $this->loadSchemaJSON('valid', '', 100);
30 $this->assertTrue($cli->initialise());
36 $this->loadSchemaJSON('badstatus', '', 100);
38 $this->assertFalse($cli->initialise(false));
45 $this->assertFalse($cli->initialise(false));
51 $this->assertFalse($cli->initialise());
57 $n = $cli->createNotifiers([3, 2, 1, 0], true);
58 $this->assertEquals(3, count($n));
59 $this->assertInstanceOf(TodayNotifier::class, $n[0]);
60 $this->assertInstanceOf(ReminderNotifier::class, $n[1]);
61 $this->assertEquals([3, 2, 1], $n[1]->getDaysBefore());
62 $this->assertInstanceOf(OverdueNotifier::class, $n[2]);
64 $n = $cli->createNotifiers([0], true);
65 $this->assertEquals(2, count($n));
66 $this->assertInstanceOf(TodayNotifier::class, $n[0]);
67 $this->assertInstanceOf(OverdueNotifier::class, $n[1]);
69 $n = $cli->createNotifiers([2, 1], false);
70 $this->assertEquals(1, count($n));
71 $this->assertInstanceOf(ReminderNotifier::class, $n[0]);
72 $this->assertEquals([2, 1], $n[0]->getDaysBefore());
74 $n = $cli->createNotifiers([], false);
75 $this->assertEquals(0, count($n));
80 $auth->createUser('user1', 'abcdefg', 'Some One', 'so@example.com');
84 $this->loadSchemaJSON('valid', '', 100);
86 $this->assertTrue($cli->initialise());
91 $data = ['duedate' => '2023-03-27',
96 'assignees' => ['Some One <so@example.com>'],
102 $access->saveData($data);
105 $notifier = $this->createMock(TodayNotifier::class);
106 $notifier->expects($this->once())
107 ->method('sendMessage')
108 ->with($this->equalTo($page),
109 $this->equalTo($page_title),
110 $this->equalTo(''),
111 $this->equalTo(''),
112 $this->equalTo($expected_data),
113 $this->equalTo($expected_data)
117 $assignments->assignPageSchema($page, 'valid');
119 $cli->processTask($page, [$notifier]);
124 $auth->createUser('user1', 'abcdefg', 'Some One', 'so@example.com');
128 $this->loadSchemaJSON('valid', '', 100);
130 $this->assertTrue($cli->initialise());
133 $data = ['duedate' => '2023-03-27',
147 'assignees' => ['Some One <so@example.com>'],
153 $access->saveData($data);
155 $assignments->assignPageSchema($page[0], 'valid');
162 'assignees' => ['Some One <so@example.com>'],
168 $access->saveData($data);
170 $assignments->assignPageSchema($page[1], 'valid');
173 $notifier = $this->createMock(TodayNotifier::class);
174 $notifier->expects($this->exactly(2))
175 ->method('sendMessage')
176 ->withConsecutive([$this->equalTo($page[1]),
177 $this->equalTo($page_title[1]),
178 $this->equalTo(''),
179 $this->equalTo(''),
180 $this->equalTo($expected_data[1]),
181 $this->equalTo($expected_data[1])],
182 [$this->equalTo($page[0]),
183 $this->equalTo($page_title[0]),
184 $this->equalTo(''),
185 $this->equalTo(''),
186 $this->equalTo($expected_data[0]),
187 $this->equalTo($expected_data[0])]
189 $cli->notifiers[] = $notifier;
191 $cli->testing = true;
193 $cli->notify(false);