Passed
Push — master ( ad0e9b...345304 )
by IRFA
03:47
created

Testing::testManualLocking()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 10
rs 10
1
<?php 
2
namespace Irfa\Lockout\Func;
3
4
use Irfa\Lockout\Func\Core;
5
use View;
6
use File;
7
8
class Testing extends Core {
9
	public function testWriteEventFailedLogin($username){
10
11
    	$this->eventFailedLogin($username);
12
13
		$input = $username;
14
		$dir = config('irfa.lockout.lockout_file_path');
15
		$path = $dir.md5($input);
16
17
    	if(File::exists($path))
18
        {
19
        	return true;
20
        } 
21
    		return false;
22
    }
23
    public function testWritable($username){
24
		$input = $username;
25
		$dir = config('irfa.lockout.lockout_file_path');
26
		$path = $dir.md5($input);
27
28
    	if(is_writable($path))
29
        {
30
        	return true;
31
        } 
32
    		return false;
33
    }
34
35
    public function testManualLocking($username){
36
        $input = $username;
37
        $dir = config('irfa.lockout.lockout_file_path');
38
        $path = $dir.md5($input);
0 ignored issues
show
Unused Code introduced by
The assignment to $path is dead and can be removed.
Loading history...
39
40
        if($this->lock_account($username))
41
        {
42
            return true;
43
        } 
44
            return false;
45
    }
46
47
    public function testUnlocking($username){
48
        $input = $username;
49
        $dir = config('irfa.lockout.lockout_file_path');
50
        $path = $dir.md5($input);
0 ignored issues
show
Unused Code introduced by
The assignment to $path is dead and can be removed.
Loading history...
51
        $unlock =  $this->test_unlock_account($username);
52
        if($unlock)
53
        {
54
            return true;
55
        } 
56
            return false;
57
    }
58
    public function testLockLogin($username){
59
        $input = $username;
60
        $dir = config('irfa.lockout.lockout_file_path');
61
        $path = $dir.md5($input);
0 ignored issues
show
Unused Code introduced by
The assignment to $path is dead and can be removed.
Loading history...
62
        $unlock =  $this->lockLogin($username);
63
        if($unlock)
64
        {
65
            return true;
66
        } 
67
            return false;
68
    }
69
}
70