<commit_before><?php

/**
 *	@author <NAME> <<EMAIL>>
 *	@license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
 */
use PHPUnit_Framework_TestCase as TestCase;
use Essence\Essence;



/**
 *	Test case for Providers.
 */
class ProvidersTest extends TestCase {

	/**
	 *
	 */
	public $Essence = null;



	/**
	 *
	 */
	public function setUp() {
		$this->Essence = new Essence();
	}



	/**
	 *	Tests essence on real providers.
	 *
	 *	@dataProvider providerProvider
	 *	@param $name Provider name.
	 *	@param $url URL to embed.
	 *	@param $property Name of the property to test.
	 *	@param $value Property value.
	 */
	public function testEmbed($name, $url, $property, $value) {
		$Media = $this->Essence->embed($url);

		if (!$Media) {
			$this->markTestSkipped("Unable to embed '$url'");
		}

		if ($property) {
			if (!$Media->has($property)) {
				$this->markTestSkipped("Unable to find '$property'");
			}<commit_msg>Fixed a bad method call<commit_after><?php

/**
 *	@author <NAME> <<EMAIL>>
 *	@license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
 */
use PHPUnit_Framework_TestCase as TestCase;
use Essence\Essence;



/**
 *	Test case for Providers.
 */
class ProvidersTest extends TestCase {

	/**
	 *
	 */
	public $Essence = null;



	/**
	 *
	 */
	public function setUp() {
		$this->Essence = new Essence();
	}



	/**
	 *	Tests essence on real providers.
	 *
	 *	@dataProvider providerProvider
	 *	@param $name Provider name.
	 *	@param $url URL to embed.
	 *	@param $property Name of the property to test.
	 *	@param $value Property value.
	 */
	public function testExtract($name, $url, $property, $value) {
		$Media = $this->Essence->extract($url);

		if (!$Media) {
			$this->markTestSkipped("Unable to embed '$url'");
		}

		if ($property) {
			if (!$Media->has($property)) {
				$this->markTestSkipped("Unable to find '$property'");
			}
{'fraction_non_alphanumeric': 0.1664899257688229, 'fraction_numerical': 0.0010604453870625664, 'mean_word_length': 3.3180778032036615, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '3927376', 'n_tokens_mistral': 708, 'n_tokens_neox': 630, 'n_words': 166}