Alternc  latest
Alternc logiel libre pour l'hébergement
m_htaTest Class Reference
+ Inheritance diagram for m_htaTest:

Public Member Functions

 testM_webaccess ()
 @covers m_hta::m_webaccess More...
 
 testAlternc_password_policy ()
 @covers m_hta::alternc_password_policy More...
 
 testHook_menu ()
 @covers m_hta::hook_menu More...
 
 testCreateDir ()
 @covers m_hta::CreateDir More...
 
 testListDir ()
 @covers m_hta::ListDir More...
 
 testIs_protected ()
 @covers m_hta::is_protected More...
 
 testGet_hta_detail ()
 @covers m_hta::get_hta_detail More...
 
 testDelDir ()
 @covers m_hta::DelDir More...
 
 testDelDirNotEmpty ()
 @covers m_hta::DelDir More...
 
 testAdd_user ()
 @covers m_hta::add_user More...
 
 testDel_user ()
 @covers m_hta::del_user More...
 
 testChange_pass ()
 @covers m_hta::change_pass More...
 
 test_reading_htaccess ()
 @covers m_hta::_reading_htaccess More...
 

Public Attributes

const PATH_HTACCESS = "/tmp/.htaccess"
 
const PATH_HTPASSWD = "/tmp/.htpasswd"
 

Protected Member Functions

 setUp ()
 Sets up the fixture, for example, opens a network connection. More...
 
 tearDown ()
 Tears down the fixture, for example, closes a network connection. More...
 

Protected Attributes

 $object
 

Detailed Description

Definition at line 7 of file m_htaTest.php.

Member Function Documentation

◆ setUp()

m_htaTest::setUp ( )
protected

Sets up the fixture, for example, opens a network connection.

This method is called before a test is executed.

Definition at line 21 of file m_htaTest.php.

22  {
23  parent::setUp();
24  touch(self::PATH_HTACCESS);
25  touch(self::PATH_HTPASSWD);
26  $file_content = "AuthUserFile \"/tmp/.htpasswd\"\nAuthName \"Restricted area\"\nAuthType Basic\nrequire valid-user\n";
27  file_put_contents(self::PATH_HTACCESS,$file_content);
28  $this->object = new m_hta;
29  }
This class handle folder web restricted access through .htaccess/.htpassword files.
Definition: m_hta.php:27

◆ tearDown()

m_htaTest::tearDown ( )
protected

Tears down the fixture, for example, closes a network connection.

This method is called after a test is executed.

Definition at line 35 of file m_htaTest.php.

36  {
37  parent::tearDown();
38  if(file_exists(self::PATH_HTACCESS)){
39  unlink (self::PATH_HTACCESS);
40  }
41  if(file_exists(self::PATH_HTPASSWD)){
42  unlink (self::PATH_HTPASSWD);
43  }
44  }

◆ test_reading_htaccess()

m_htaTest::test_reading_htaccess ( )

@covers m_hta::_reading_htaccess

Todo:
Implement test_reading_htaccess().

Definition at line 194 of file m_htaTest.php.

195  {
196  // Remove the following lines when you implement this test.
197  $this->markTestIncomplete(
198  'This test has not been implemented yet.'
199  );
200  }

◆ testAdd_user()

m_htaTest::testAdd_user ( )

@covers m_hta::add_user

Todo:
Implement testAdd_user().

Definition at line 158 of file m_htaTest.php.

159  {
160  // Remove the following lines when you implement this test.
161  $this->markTestIncomplete(
162  'This test has not been implemented yet.'
163  );
164  }

◆ testAlternc_password_policy()

m_htaTest::testAlternc_password_policy ( )

@covers m_hta::alternc_password_policy

Todo:
Implement testAlternc_password_policy().

Definition at line 62 of file m_htaTest.php.

63  {
64  // Remove the following lines when you implement this test.
65  $this->markTestIncomplete(
66  'This test has not been implemented yet.'
67  );
68  }

◆ testChange_pass()

m_htaTest::testChange_pass ( )

@covers m_hta::change_pass

Todo:
Implement testChange_pass().

Definition at line 182 of file m_htaTest.php.

183  {
184  // Remove the following lines when you implement this test.
185  $this->markTestIncomplete(
186  'This test has not been implemented yet.'
187  );
188  }

◆ testCreateDir()

m_htaTest::testCreateDir ( )

@covers m_hta::CreateDir

Todo:
Implement testCreateDir().

Definition at line 86 of file m_htaTest.php.

87  {
88  // Remove the following lines when you implement this test.
89  $this->markTestIncomplete(
90  'This test has not been implemented yet.'
91  );
92  }

◆ testDel_user()

m_htaTest::testDel_user ( )

@covers m_hta::del_user

Todo:
Implement testDel_user().

Definition at line 170 of file m_htaTest.php.

171  {
172  // Remove the following lines when you implement this test.
173  $this->markTestIncomplete(
174  'This test has not been implemented yet.'
175  );
176  }

◆ testDelDir()

m_htaTest::testDelDir ( )

@covers m_hta::DelDir

Definition at line 133 of file m_htaTest.php.

134  {
135  $result = $this->object->DelDir("/tmp",TRUE);
136  $this->assertTrue($result);
137  $this->assertFileNotExists(self::PATH_HTACCESS);
138  $this->assertFileNotExists(self::PATH_HTPASSWD);
139  }

◆ testDelDirNotEmpty()

m_htaTest::testDelDirNotEmpty ( )

@covers m_hta::DelDir

Definition at line 144 of file m_htaTest.php.

145  {
146  file_put_contents(self::PATH_HTACCESS, "\nphpunit", FILE_APPEND);
147  $result = $this->object->DelDir("/tmp",TRUE);
148  $this->assertTrue($result);
149  $this->assertFileExists(self::PATH_HTACCESS);
150  $this->assertFileNotExists(self::PATH_HTPASSWD);
151  $this->assertTrue("phpunit" == trim(file_get_contents(self::PATH_HTACCESS)));
152  }

◆ testGet_hta_detail()

m_htaTest::testGet_hta_detail ( )

@covers m_hta::get_hta_detail

Todo:
Implement testGet_hta_detail().

Definition at line 122 of file m_htaTest.php.

123  {
124  // Remove the following lines when you implement this test.
125  $this->markTestIncomplete(
126  'This test has not been implemented yet.'
127  );
128  }

◆ testHook_menu()

m_htaTest::testHook_menu ( )

@covers m_hta::hook_menu

Todo:
Implement testHook_menu().

Definition at line 74 of file m_htaTest.php.

75  {
76  // Remove the following lines when you implement this test.
77  $this->markTestIncomplete(
78  'This test has not been implemented yet.'
79  );
80  }

◆ testIs_protected()

m_htaTest::testIs_protected ( )

@covers m_hta::is_protected

Todo:
Implement testIs_protected().

Definition at line 110 of file m_htaTest.php.

111  {
112  // Remove the following lines when you implement this test.
113  $this->markTestIncomplete(
114  'This test has not been implemented yet.'
115  );
116  }

◆ testListDir()

m_htaTest::testListDir ( )

@covers m_hta::ListDir

Todo:
Implement testListDir().

Definition at line 98 of file m_htaTest.php.

99  {
100  // Remove the following lines when you implement this test.
101  $this->markTestIncomplete(
102  'This test has not been implemented yet.'
103  );
104  }

◆ testM_webaccess()

m_htaTest::testM_webaccess ( )

@covers m_hta::m_webaccess

Todo:
Implement testM_webaccess().

Definition at line 50 of file m_htaTest.php.

51  {
52  // Remove the following lines when you implement this test.
53  $this->markTestIncomplete(
54  'This test has not been implemented yet.'
55  );
56  }

Member Data Documentation

◆ $object

m_htaTest::$object
protected

Definition at line 12 of file m_htaTest.php.

◆ PATH_HTACCESS

const m_htaTest::PATH_HTACCESS = "/tmp/.htaccess"

Definition at line 14 of file m_htaTest.php.

◆ PATH_HTPASSWD

const m_htaTest::PATH_HTPASSWD = "/tmp/.htpasswd"

Definition at line 15 of file m_htaTest.php.


The documentation for this class was generated from the following file: