@@ -330,7 +330,7 @@ public function testRetrieveSchemaFromPackage()
330330 $ this ->assertEquals ('454f423bd7edddf0bc77af4130ed9161 ' , md5 (json_encode ($ schema )));
331331 }
332332
333- public function testJsonSchemaOrgMediaTypeHack ()
333+ public function testJsonSchemaOrgMediaTypeBlacklistDefault ()
334334 {
335335 $ mock = $ this ->getMock ('JsonSchema\Uri\UriRetriever ' , array ('getContentType ' ));
336336 $ mock ->method ('getContentType ' )->willReturn ('Application/X-Fake-Type ' );
@@ -339,6 +339,28 @@ public function testJsonSchemaOrgMediaTypeHack()
339339 $ this ->assertTrue ($ retriever ->confirmMediaType ($ mock , 'http://json-schema.org/ ' ));
340340 }
341341
342+ /**
343+ * @expectedException \JsonSchema\Exception\InvalidSchemaMediaTypeException
344+ */
345+ public function testJsonSchemaOrgMediaTypeBlacklistUnknown ()
346+ {
347+ $ mock = $ this ->getMock ('JsonSchema\Uri\UriRetriever ' , array ('getContentType ' ));
348+ $ mock ->method ('getContentType ' )->willReturn ('Application/X-Fake-Type ' );
349+ $ retriever = new UriRetriever ();
350+
351+ $ retriever ->confirmMediaType ($ mock , 'http://iglucentral.com ' );
352+ }
353+
354+ public function testJsonSchemaOrgMediaTypeBlacklistAdded ()
355+ {
356+ $ mock = $ this ->getMock ('JsonSchema\Uri\UriRetriever ' , array ('getContentType ' ));
357+ $ mock ->method ('getContentType ' )->willReturn ('Application/X-Fake-Type ' );
358+ $ retriever = new UriRetriever ();
359+ $ retriever ->addBlacklistedEndpoint ('http://iglucentral.com ' );
360+
361+ $ retriever ->confirmMediaType ($ mock , 'http://iglucentral.com ' );
362+ }
363+
342364 public function testSchemaCache ()
343365 {
344366 $ retriever = new UriRetriever ();
0 commit comments