<commit_before><?php

use Fhaculty\Graph\Graph;

class GraphTest extends PHPUnit_Framework_TestCase
{
    public function setup(){
        $this->graph = new Graph();
    }
    
    public function testBalance(){
        $this->assertEquals(0,$this->graph->getBalance());
    }
    
    public function testGetWeightMin(){
        $this->assertEquals(NULL,$this->graph->getWeightMin());
    }
    
    public function testCanCreateVertex(){
        $this->graph->createVertex(0);
    }

// commented out because expecting base Exception is not allowed
//     /**
//      * @expectedException Exception
//      */
//     public function testCanNotCreateVertexDuplicateId(){
//         $this->graph->createVertex(1);
//         $this->graph->createVertex(1);
//     }
    
    
}<commit_msg>Test creating vertices<commit_after><?php

use Fhaculty\Graph\Vertex;

use Fhaculty\Graph\Exception\OverflowException;

use Fhaculty\Graph\Graph;

class GraphTest extends PHPUnit_Framework_TestCase
{
    public function setup(){
        $this->graph = new Graph();
    }
    
    public function testBalance(){
        $this->assertEquals(0,$this->graph->getBalance());
    }
    
    public function testGetWeightMin(){
        $this->assertEquals(NULL,$this->graph->getWeightMin());
    }
    
    /**
     * check to make sure we can actually create vertices with automatic IDs 
     */
    public function testCanCreateVertex(){
        $graph = new Graph();
        $vertex = $graph->createVertex();
        $this->assertInstanceOf('\Fhaculty\Graph\Vertex',$vertex);
    }
    
    /**
     * check to make sure we can actually create vertices with automatic IDs 
     */
    public function testCanCreateVertexId(){
        $graph = new Graph();
        $vertex = $graph->createVertex(11);
        $this->assertInstanceOf('\Fhaculty\Graph\Vertex',$vertex);
        $this->assertEquals(11,$vertex->getId());
    }
    
    /**
     * fail to create two vertices with same ID
     * @expectedException OverflowException
     */
    public function testFailDuplicateVertex(){
        $graph = new Graph();
        $graph->createVertex(33);
        $graph->createVertex(33);
    }

// commented out because expecting base Exception is not allowed
//     /**
//      * @expectedException Exception
//      */
//     public function testCanNotCreateVertexDuplicateId(){
//         $this->graph->createVertex(1);
//         $this->graph->createVertex(1);
//     }
    
    
}
{'fraction_non_alphanumeric': 0.13479496548924078, 'fraction_numerical': 0.0060901339829476245, 'mean_word_length': 2.5351506456241033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '5418677', 'n_tokens_mistral': 681, 'n_tokens_neox': 680, 'n_words': 145}