preliminary hash ban testing
This commit is contained in:
		
							parent
							
								
									963535b748
								
							
						
					
					
						commit
						fbd7039ad3
					
				
							
								
								
									
										19
									
								
								contrib/image_hash_ban/test.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								contrib/image_hash_ban/test.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					class ImageHashBanUnitTest extends UnitTestCase {
 | 
				
			||||||
 | 
						public function _broken_testUploadFailsWhenBanned() {
 | 
				
			||||||
 | 
							$ihb = new ImageHashBan();
 | 
				
			||||||
 | 
							$due = new DataUploadEvent();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								$ihb->receive_event($due);
 | 
				
			||||||
 | 
								$this->assertTrue(false); // shouldn't work
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							catch(DataUploadException $ex) {
 | 
				
			||||||
 | 
								$this->assertTrue(true); // should fail
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							catch(Exception $ex) {
 | 
				
			||||||
 | 
								$this->assertTrue(false); // but not with any other error
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					?>
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user