<commit_before><?php

namespace Saft\Rdf;

class NamedNodeTest extends \PHPUnit_Framework_TestCase
{   
    protected $testUri = 'http://saft/test/';
    
    /**
     * 
     */
    public function setUp()
    {
        parent::setUp();
        
        $this->fixture = new \Saft\Rdf\NamedNode($this->testUri);
    }
    
    /**
     * 
     */
    public function tearDown()
    {
        parent::tearDown();
    }
    
    /**
     * Tests check
     */
    public function testCheck()
    {
        $this->assertFalse($this->fixture->check(""));
        $this->assertFalse($this->fixture->check("http//foobar/"));
        
        $this->assertTrue($this->fixture->check("http:foobar/"));
        $this->assertTrue($this->fixture->check("http://foobar/"));
        $this->assertTrue($this->fixture->check("http://foobar:42/"));
        $this->assertTrue($this->fixture->check("http://foo:bar@foobar/"));
    }
    
    /**
     * Tests instanciation
     */
    public function testInstanciation_invalidUri()
    {
        $this->setExpectedException('\Exception');
        
        $this->fixture = new \Saft\Rdf\NamedNode('foo');
    }
    
    public function testInstanciation_validUri()
    {
        $this->fixture = new \Saft\Rdf\NamedNode($this->testUri);
    }
    
    /**
     * Tests isBlank
     */
    public function testIsBlank()
    {
        $this->assertFalse($this->fixture->isBlank());
    }
    
    /**
     * Tests isConcrete
     */
    public function testIsConcrete()
    {
        $this->assertFalse($this->fixture->isConcrete());
    }
    
    /**
     * Tests isLiteral
     */
    public function testIsLiteral()
    {<commit_msg>Extend NamedNode's instanciation testcases with additional value check<commit_after><?php

namespace Saft\Rdf;

class NamedNodeTest extends \PHPUnit_Framework_TestCase
{   
    protected $testUri = 'http://saft/test/';
    
    /**
     * 
     */
    public function setUp()
    {
        parent::setUp();
        
        $this->fixture = new \Saft\Rdf\NamedNode($this->testUri);
    }
    
    /**
     * 
     */
    public function tearDown()
    {
        parent::tearDown();
    }
    
    /**
     * Tests check
     */
    public function testCheck()
    {
        $this->assertFalse($this->fixture->check(""));
        $this->assertFalse($this->fixture->check("http//foobar/"));
        
        $this->assertTrue($this->fixture->check("http:foobar/"));
        $this->assertTrue($this->fixture->check("http://foobar/"));
        $this->assertTrue($this->fixture->check("http://foobar:42/"));
        $this->assertTrue($this->fixture->check("http://foo:bar@foobar/"));
    }
    
    /**
     * Tests instanciation
     */
    public function testInstanciation_invalidUri()
    {
        $this->setExpectedException('\Exception');
        
        $this->fixture = new \Saft\Rdf\NamedNode('foo');
    }
    
    public function testInstanciation_null()
    {
        $this->fixture = new \Saft\Rdf\NamedNode(null);
        $this->assertEquals(null, $this->fixture->getValue());
    }
    
    public function testInstanciation_validUri()
    {
        $this->fixture = new \Saft\Rdf\NamedNode($this->testUri);
        $this->assertEquals($this->testUri, $this->fixture->getValue());
    }
    
    public function testInstanciation_variable()
    {
        $this->fixture = new \Saft\Rdf\NamedNode("?s");
        $this->assertEquals("?s", $this->fixture->getValue());
    }
    
    /**
     * Tests isBlank
     */
    public function testIsBlank()
    {
        $this->assertFalse($this->fixture->isBlank());
    }
    
    /**
     * Tests isConcrete
     */
    public function testIsConcrete()
    {
        $this->assertFalse($this->fixture->isConcrete());
    }
    
    /**
     * Tests isLiteral
     */
    public function testIsLiteral()
    {
{'fraction_non_alphanumeric': 0.16962421711899792, 'fraction_numerical': 0.0010438413361169101, 'mean_word_length': 2.0961227786752827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2475506', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1206, 'n_words': 153}