mirror of
				https://github.com/brmlab/brmsklad.git
				synced 2025-10-31 00:03:58 +01:00 
			
		
		
		
	Backup of current cakephp version
This commit is contained in:
		
							parent
							
								
									b8f82da6f8
								
							
						
					
					
						commit
						5a580df460
					
				
					 925 changed files with 238041 additions and 1 deletions
				
			
		
							
								
								
									
										64
									
								
								lib/Cake/Test/Case/Network/Http/BasicAuthenticationTest.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								lib/Cake/Test/Case/Network/Http/BasicAuthenticationTest.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,64 @@ | |||
| <?php | ||||
| /** | ||||
|  * BasicAuthenticationTest file | ||||
|  * | ||||
|  * PHP 5 | ||||
|  * | ||||
|  * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> | ||||
|  * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||||
|  * | ||||
|  * Licensed under The MIT License | ||||
|  * Redistributions of files must retain the above copyright notice | ||||
|  * | ||||
|  * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||||
|  * @link          http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests | ||||
|  * @package       Cake.Test.Case.Network.Http | ||||
|  * @since         CakePHP(tm) v 2.0.0 | ||||
|  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) | ||||
|  */ | ||||
| 
 | ||||
| App::uses('HttpSocket', 'Network/Http'); | ||||
| App::uses('BasicAuthentication', 'Network/Http'); | ||||
| 
 | ||||
| /** | ||||
|  * BasicMethodTest class | ||||
|  * | ||||
|  * @package       Cake.Test.Case.Network.Http | ||||
|  */ | ||||
| class BasicAuthenticationTest extends CakeTestCase { | ||||
| 
 | ||||
| /** | ||||
|  * testAuthentication method | ||||
|  * | ||||
|  * @return void | ||||
|  */ | ||||
| 	public function testAuthentication() { | ||||
| 		$http = new HttpSocket(); | ||||
| 		$auth = array( | ||||
| 			'method' => 'Basic', | ||||
| 			'user' => 'mark', | ||||
| 			'pass' => 'secret' | ||||
| 		); | ||||
| 
 | ||||
| 		BasicAuthentication::authentication($http, $auth); | ||||
| 		$this->assertEquals('Basic bWFyazpzZWNyZXQ=', $http->request['header']['Authorization']); | ||||
| 	} | ||||
| 
 | ||||
| /** | ||||
|  * testProxyAuthentication method | ||||
|  * | ||||
|  * @return void | ||||
|  */ | ||||
| 	public function testProxyAuthentication() { | ||||
| 		$http = new HttpSocket(); | ||||
| 		$proxy = array( | ||||
| 			'method' => 'Basic', | ||||
| 			'user' => 'mark', | ||||
| 			'pass' => 'secret' | ||||
| 		); | ||||
| 
 | ||||
| 		BasicAuthentication::proxyAuthentication($http, $proxy); | ||||
| 		$this->assertEquals('Basic bWFyazpzZWNyZXQ=', $http->request['header']['Proxy-Authorization']); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brm Ko
						Brm Ko