Skip to content
This repository was archived by the owner on Jan 18, 2018. It is now read-only.

Commit 267c486

Browse files
Removed old code
1 parent 1f8d24a commit 267c486

2 files changed

Lines changed: 0 additions & 137 deletions

File tree

tests/EloquentGroupTest.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,38 +52,6 @@ public function testGroupName()
5252
$this->assertEquals('foo', $group->getName());
5353
}
5454

55-
// public function testSettingPermissions()
56-
// {
57-
// $permissions = array(
58-
// 'foo' => 1,
59-
// 'bar' => 1,
60-
// 'baz' => 1,
61-
// 'qux' => 1,
62-
// );
63-
64-
// $group = new Group;
65-
66-
// $expected = '{"foo":1,"bar":1,"baz":1,"qux":1}';
67-
68-
// $this->assertEquals($expected, $group->setPermissions($permissions));
69-
// }
70-
71-
// public function testSettingPermissionsWhenSomeAreSetTo0()
72-
// {
73-
// $permissions = array(
74-
// 'foo' => 1,
75-
// 'bar' => 1,
76-
// 'baz' => 0,
77-
// 'qux' => 1,
78-
// );
79-
80-
// $group = new Group;
81-
82-
// $expected = '{"foo":1,"bar":1,"qux":1}';
83-
84-
// $this->assertEquals($expected, $group->setPermissions($permissions));
85-
// }
86-
8755
public function testPermissionsAreMergedAndRemovedProperly()
8856
{
8957
$group = new Group();

tests/EloquentThrottleTest.php

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -134,111 +134,6 @@ public function testUnsuspend()
134134
$this->assertNull($throttle->suspended_at);
135135
}
136136

137-
// public function testIsSuspended()
138-
// {
139-
// $throttle = new Throttle;
140-
// $this->assertFalse($throttle->isSuspended());
141-
// }
142-
143-
// public function testIsSuspendedRemovesSuspensionIfEnoughTimeHasPassed()
144-
// {
145-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[save]');
146-
// $throttle->shouldReceive('save')->once();
147-
// $throttle->suspended = true;
148-
149-
150-
// // Still suspended
151-
// $throttle->setSuspensionTime(11);
152-
// $suspendedAt = new DateTime;
153-
// $suspendedAt->modify('-10 minutes');
154-
// $throttle->suspended_at = $suspendedAt;
155-
156-
// $this->assertTrue($throttle->isSuspended());
157-
158-
// // Unsuspend time, because suspension time is 9
159-
// // minutes however we were suspended at 10 minutes
160-
// // ago
161-
// $throttle->setSuspensionTime(9);
162-
// $this->assertFalse($throttle->isSuspended());
163-
// }
164-
165-
// public function testAddLoginAttempt()
166-
// {
167-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[suspend,save]');
168-
// $throttle->shouldReceive('save')->once();
169-
// $throttle->shouldReceive('suspend')->once();
170-
171-
// $throttle->setAttemptLimit(5);
172-
// $throttle->attempts = 3;
173-
174-
// $throttle->addLoginAttempt();
175-
// $this->assertEquals(4, $throttle->getLoginAttempts());
176-
177-
// $throttle->addLoginAttempt();
178-
// $this->assertEquals(5, $throttle->getLoginAttempts());
179-
// }
180-
181-
// public function testBanning()
182-
// {
183-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[save]');
184-
// $throttle->shouldReceive('save')->twice();
185-
186-
// $throttle->ban();
187-
// $this->assertTrue($throttle->isBanned());
188-
// $throttle->unban();
189-
// $this->assertFalse($throttle->isBanned());
190-
// }
191-
192-
// /**
193-
// * @expectedException Cartalyst\Sentry\Throttling\UserBannedException
194-
// */
195-
// public function testCheckingThrowsProperExceptionWhenUserIsBanned()
196-
// {
197-
// $user = m::mock('Cartalyst\Sentry\Users\UserInterface');
198-
// $user->shouldReceive('getLogin')->once()->andReturn('foo');
199-
200-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[isBanned,isSuspended,getUser]');
201-
// $throttle->shouldReceive('isBanned')->once()->andReturn(true);
202-
// $throttle->shouldReceive('isSuspended')->never();
203-
// $throttle->shouldReceive('getUser')->once()->andReturn($user);
204-
205-
// $throttle->check();
206-
// }
207-
208-
// /**
209-
// * @expectedException Cartalyst\Sentry\Throttling\UserSuspendedException
210-
// */
211-
// public function testCheckingThrowsProperExceptionWhenUserIsSuspended()
212-
// {
213-
// $user = m::mock('Cartalyst\Sentry\Users\UserInterface');
214-
// $user->shouldReceive('getLogin')->once()->andReturn('foo');
215-
216-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[isBanned,isSuspended,getUser]');
217-
// $throttle->shouldReceive('isBanned')->once()->andReturn(false);
218-
// $throttle->shouldReceive('isSuspended')->once()->andReturn(true);
219-
// $throttle->shouldReceive('getUser')->once()->andReturn($user);
220-
221-
// $throttle->check();
222-
// }
223-
224-
// public function testCheckingWhenUserIsOkay()
225-
// {
226-
// $throttle = m::mock('Cartalyst\Sentry\Throttling\Eloquent\Throttle[isBanned,isSuspended]');
227-
// $throttle->shouldReceive('isBanned')->once()->andReturn(false);
228-
// $throttle->shouldReceive('isSuspended')->once()->andReturn(false);
229-
230-
// $this->assertTrue($throttle->check());
231-
// }
232-
233-
// public function testEnabling()
234-
// {
235-
// $throttle = new Throttle;
236-
// $throttle->enable();
237-
// $this->assertTrue($throttle->isEnabled());
238-
// $throttle->disable();
239-
// $this->assertFalse($throttle->isEnabled());
240-
// }
241-
242137
protected function addMockConnection($model)
243138
{
244139
$model->setConnectionResolver($resolver = m::mock('Illuminate\Database\ConnectionResolverInterface'));

0 commit comments

Comments
 (0)