<commit_before><?php
namespace Edu\Cnm\DdcAaaa\Test;

use Edu\Cnm\DdcAaaa\{Status};

// grab the project test parameters
require_once("AaaaTest.php");

// grab the class under scrutiny
require_once(dirname(__DIR__) . "/classes/autoload.php");

/**
 * Full PHPUnit test for the Status class
 *
 * This is a complete PHPUnit test of the StatusTest class. It is complete because *ALL* mySQL/PDO enabled methods
 * are tested for both invalid and valid inputs.
 *
 * @see status
 **/
class Status extends AaaaTest {
	/**
	 * content of the Status
	 * @var string $VALID_STATUS
	 **/
	protected $VALID_STATUSTYPEID = "PHPUnit test passing";
	/**
	 * content of the updated
	 * @var string $VALID_STATUSTYPENAME
	 **/
	protected $VALID_STATUSTYPENAME = "PHPUnit test still passing";

	/**
	 * create dependent objects before running each test
	 **/
	public final function setUp() {
		// run the default setUp() method first
		parent::setUp();
	}
		/**
		 * test inserting a valid Status and verify that the actual mySQL data matches
		 */
		public function testInsertValidStatus() {

			// count the number of rows and save it for later
			$numRows = $this->getConnection()->getRowCount("status");

			// create a new Status and inser to into mySQL
			$status = new Status(null, $this->VALID_STATUSTYPEID, $this->VALID_STATUSTYPENAME);
			$status->insert($this->getPDO());

			// grab the data from mySQL and enforce the fields match our expectations
			$pdoStatus = Status::getStatusByStatusTypeId($this->getPDO(), $syatus->getStatusTypeId());
			$this->assetEqual($numRows + 1, $this->getConnection()->getRowCount("status"));
			//$this->assertEqual(%pdoStatus->getStatusTypeId(), $this->VALID_STATUSTYPEID
			$this->assertEqual(%pdoStatus->getStatusTypeName(), $this->VALID_STATUSTYPENAME);
			}

	/**
	 * test inserting a valid Status and verify that the actual mySQL data matches
	 * @expectedException \PDOException
	 **/
	public function testInsertValidTweet() {
		// count the number of rows and save it for later
		$numRows = $this->getConnection()->getRowCount("status");

		// create a new Tweet and insert to into mySQL
		$tweet = new Tweet(null, $this->profile->getProfileId(), $this->VALID_TWEETCONTENT, $this->VALID_TWEETDATE);
		$tweet->insert($this->getPDO());

		// grab the data from mySQL and enforce the fields match our expectations
		$pdoTweet = Tweet::getTweetByTweetId($this->getPDO(), $tweet->getTweetId());
		$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount("tweet"));
		$this->assertEquals($pdoTweet->getProfileId(), $this->profile->getProfileId());
		$this->assertEquals($pdoTweet->getTweetContent(), $this->VALID_TWEETCONTENT);
		$this->assertEquals($pdoTweet->getTweetDate(), $this->VALID_TWEETDATE);
	}

	/**
	 * test inserting a Tweet that already exists
	 *<commit_msg>insert and insert invalid on status https://app.asana.com/0/202206849274532/206902611499183<commit_after><?php
namespace Edu\Cnm\DdcAaaa\Test;

use Edu\Cnm\DdcAaaa\{Status};

// grab the project test parameters
require_once("AaaaTest.php");

// grab the class under scrutiny
require_once(dirname(__DIR__) . "/classes/autoload.php");

/**
 * Full PHPUnit test for the Status class
 *
 * This is a complete PHPUnit test of the StatusTest class. It is complete because *ALL* mySQL/PDO enabled methods
 * are tested for both invalid and valid inputs.
 *
 * @see status
 **/
class Status extends AaaaTest {
	/**
	 * content of the Status
	 * @var string $VALID_STATUS
	 **/
	protected $VALID_STATUSTYPEID = "PHPUnit test passing";
	/**
	 * content of the updated
	 * @var string $VALID_STATUSTYPENAME
	 **/
	protected $VALID_STATUSTYPENAME = "PHPUnit test still passing";

	/**
	 * create dependent objects before running each test
	 **/
	public final function setUp() {
		// run the default setUp() method first
		parent::setUp();
	}
		/**
		 * test inserting a valid Status and verify that the actual mySQL data matches
		 */
		public function testInsertValidStatus() {

			// count the number of rows and save it for later
			$numRows = $this->getConnection()->getRowCount("status");

			// create a new Status and inser to into mySQL
			$status = new Status(null, $this->VALID_STATUSTYPEID, $this->VALID_STATUSTYPENAME);
			$status->insert($this->getPDO());

			// grab the data from mySQL and enforce the fields match our expectations
			$pdoStatus = Status::getStatusByStatusTypeId($this->getPDO(), $syatus->getStatusTypeId());
			$this->assetEqual($numRows + 1, $this->getConnection()->getRowCount("status"));
			//$this->assertEqual(%pdoStatus->getStatusTypeId(), $this->VALID_STATUSTYPEID
			$this->assertEqual(%pdoStatus->getStatusTypeName(), $this->VALID_STATUSTYPENAME);
			}

	/**
	 * test inserting a Status and verify that it already exists
	 * @expectedException \PDOException
	 **/
	public function testInsertValidStatus() {
		// create a Status with a non null status id and watch it fail
		$status = new Status(AaaaTest::
		:
		INVALID_KEY, $this->VALID_STATUSTYPEID, $this->VALID_STATUTYPENAME);
		$status->insert($this->getPDO());
		}
		/**
		 * test inserting a Status, editin it, and then updating it
		 **/
	public function testUpdateValidStatus() {

		// count the number of rows and save it for later
		$pdoTweet = Tweet::getTweetByTweetId($this->getPDO(), $tweet->getTweetId());
		$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount("tweet"));
		$this->assertEquals($pdoTweet->getProfileId(), $this->profile->getProfileId());
		$this->assertEquals($pdoTweet->getTweetContent(), $this->VALID_TWEETCONTENT);
		$this->assertEquals($pdoTweet->getTweetDate(), $this->VALID_TWEETDATE);
	}

	/**
	 * test inserting a Tweet that already exists
	 *
{'fraction_non_alphanumeric': 0.13515885553800247, 'fraction_numerical': 0.006143584342636475, 'mean_word_length': 4.457854406130268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 79, 'https://': 1, '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': '7539548', 'n_tokens_mistral': 1891, 'n_tokens_neox': 1715, 'n_words': 490}