5 use PHPUnit\Framework\TestCase;
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;
38 if(file_exists(self::PATH_HTACCESS)){
39 unlink (self::PATH_HTACCESS);
41 if(file_exists(self::PATH_HTPASSWD)){
42 unlink (self::PATH_HTPASSWD);
53 $this->markTestIncomplete(
54 'This test has not been implemented yet.'
65 $this->markTestIncomplete(
66 'This test has not been implemented yet.'
77 $this->markTestIncomplete(
78 'This test has not been implemented yet.'
89 $this->markTestIncomplete(
90 'This test has not been implemented yet.'
101 $this->markTestIncomplete(
102 'This test has not been implemented yet.'
113 $this->markTestIncomplete(
114 'This test has not been implemented yet.'
125 $this->markTestIncomplete(
126 'This test has not been implemented yet.'
135 $result = $this->
object->DelDir(
"/tmp",TRUE);
136 $this->assertTrue($result);
137 $this->assertFileNotExists(self::PATH_HTACCESS);
138 $this->assertFileNotExists(self::PATH_HTPASSWD);
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)));
161 $this->markTestIncomplete(
162 'This test has not been implemented yet.'
173 $this->markTestIncomplete(
174 'This test has not been implemented yet.'
185 $this->markTestIncomplete(
186 'This test has not been implemented yet.'
197 $this->markTestIncomplete(
198 'This test has not been implemented yet.'
This class handle folder web restricted access through .htaccess/.htpassword files.
testCreateDir()
@covers m_hta::CreateDir
testAlternc_password_policy()
@covers m_hta::alternc_password_policy
test_reading_htaccess()
@covers m_hta::_reading_htaccess
testDel_user()
@covers m_hta::del_user
testM_webaccess()
@covers m_hta::m_webaccess
testDelDirNotEmpty()
@covers m_hta::DelDir
testDelDir()
@covers m_hta::DelDir
testListDir()
@covers m_hta::ListDir
testChange_pass()
@covers m_hta::change_pass
tearDown()
Tears down the fixture, for example, closes a network connection.
testHook_menu()
@covers m_hta::hook_menu
setUp()
Sets up the fixture, for example, opens a network connection.
testIs_protected()
@covers m_hta::is_protected
testAdd_user()
@covers m_hta::add_user
testGet_hta_detail()
@covers m_hta::get_hta_detail