<commit_before><?php


namespace WEEEOpen\TaralloTest\Database;


use WEEEOpen\Tarallo\Product;

class ProductDAOTest extends DatabaseTest {

	//This, I hope, is (very) temporary
	private function createExampleProducts(){
		$db = $this->getDb();

		//$db->productDAO()->addProduct(new Product('Intel', 'K3k', 'dunno'));
		$db->productDAO()->addProduct(new Product('Intel', 'Lm40'));
		$db->productDAO()->addProduct(new Product('Samsong', 'JWOSQPA', 'black'));
		$db->productDAO()->addProduct(new Product('Dell', '19942', 'HD'));

	}

	public function testProduct() {
		$this->createExampleProducts();
		$db = $this->getDb();

		$product = new Product('Intel', 'K3k', 'dunno');

		$db->productDAO()->addProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel(), $product->getVariant());
		$this->assertEquals($product, $gettedProduct);
	}

	public function testProductNoVariant() {
		$db = $this->getDb();

		$product = new Product('Intel', 'K3k');

		$db->productDAO()->addProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel());
		$this->assertEquals($product, $gettedProduct);
	}

	//Is working, but need to find a way to discover if successfully is deleted
	//The test, by the way, is not working
	public function  testDeleteProduct(){
		$db = $this->getDb();

		$this->createExampleProducts();
		$product = new Product('Samsong', 'JWOSQPA', 'black');
		$db->productDAO()->deleteProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel(), $product->getVariant());
		$this->assertEquals($product, $gettedProduct);
	}
}<commit_msg>Toggle (now) useless function<commit_after><?php


namespace WEEEOpen\TaralloTest\Database;


use WEEEOpen\Tarallo\Product;

class ProductDAOTest extends DatabaseTest {


	public function testProduct() {
		$db = $this->getDb();

		$product = new Product('Intel', 'K3k', 'dunno');

		$db->productDAO()->addProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel(), $product->getVariant());
		$this->assertEquals($product, $gettedProduct);
	}

	public function testProductNoVariant() {
		$db = $this->getDb();

		$product = new Product('Intel', 'K3k');

		$db->productDAO()->addProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel());
		$this->assertEquals($product, $gettedProduct);
	}

	//Is working, but need to find a way to discover if successfully is deleted
	//The test, by the way, is not working
	public function  testDeleteProduct(){
		$db = $this->getDb();

		$product = new Product('Samsong', 'JWOSQPA', 'black');
		$db->productDAO()->deleteProduct($product);
		$gettedProduct = $db->productDAO()->getProduct($product->getBrand(), $product->getModel(), $product->getVariant());
		$this->assertEquals($product, $gettedProduct);
	}
}
{'fraction_non_alphanumeric': 0.19605844376486578, 'fraction_numerical': 0.004077471967380225, 'mean_word_length': 5.814814814814815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, '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': '7639334', 'n_tokens_mistral': 1015, 'n_tokens_neox': 941, 'n_words': 191}