MediaWiki  master
BatchRowUpdateTest Class Reference

Tests for BatchRowUpdate and its components. More...

Inheritance diagram for BatchRowUpdateTest:
Collaboration diagram for BatchRowUpdateTest:

Public Member Functions

 testReaderBasicIterate ()
 
 testReaderGetPrimaryKey ( $message, array $expected, array $row)
 provider_readerGetPrimaryKey More...
 
 testReaderSelectConditionsMultiplePrimaryKeys ( $message, $expectedSecondIteration, $primaryKeys, $batchSize=3)
 Slightly hackish to use reflection, but asserting different parameters to consecutive calls of Database::select in phpunit is error prone. More...
 
 testReaderSetFetchColumns ( $message, array $columns, array $primaryKeys, array $fetchColumns)
 provider_readerSetFetchColumns More...
 
 testWriterBasicFunctionality ()
 

Static Public Member Functions

static provider_readerGetPrimaryKey ()
 
static provider_readerSelectConditions ()
 
static provider_readerSetFetchColumns ()
 

Protected Member Functions

 consecutivelyReturnFromSelect (array $results)
 
 genSelectResult ( $batchSize, $numRows, $rowGenerator)
 
 mockDb ( $methods=[])
 
 mockDbConsecutiveSelect (array $retvals)
 

Static Protected Member Functions

static mockUpdate (array $changes)
 

Detailed Description

Tests for BatchRowUpdate and its components.

db

BatchRowUpdate BatchRowIterator BatchRowWriter

Definition at line 12 of file BatchRowUpdateTest.php.

Member Function Documentation

◆ consecutivelyReturnFromSelect()

BatchRowUpdateTest::consecutivelyReturnFromSelect ( array  $results)
protected

Definition at line 214 of file BatchRowUpdateTest.php.

References $rows, and as.

Referenced by mockDbConsecutiveSelect().

◆ genSelectResult()

BatchRowUpdateTest::genSelectResult (   $batchSize,
  $numRows,
  $rowGenerator 
)
protected

Definition at line 224 of file BatchRowUpdateTest.php.

References $res, $rows, and object.

Referenced by testReaderBasicIterate(), and testReaderSelectConditionsMultiplePrimaryKeys().

◆ mockDb()

BatchRowUpdateTest::mockDb (   $methods = [])
protected

◆ mockDbConsecutiveSelect()

BatchRowUpdateTest::mockDbConsecutiveSelect ( array  $retvals)
protected

◆ mockUpdate()

static BatchRowUpdateTest::mockUpdate ( array  $changes)
staticprotected

Definition at line 30 of file BatchRowUpdateTest.php.

◆ provider_readerGetPrimaryKey()

static BatchRowUpdateTest::provider_readerGetPrimaryKey ( )
static

Definition at line 56 of file BatchRowUpdateTest.php.

◆ provider_readerSelectConditions()

static BatchRowUpdateTest::provider_readerSelectConditions ( )
static

Definition at line 142 of file BatchRowUpdateTest.php.

◆ provider_readerSetFetchColumns()

static BatchRowUpdateTest::provider_readerSetFetchColumns ( )
static

Definition at line 87 of file BatchRowUpdateTest.php.

◆ testReaderBasicIterate()

BatchRowUpdateTest::testReaderBasicIterate ( )

Definition at line 38 of file BatchRowUpdateTest.php.

References $response, $rows, as, genSelectResult(), and mockDbConsecutiveSelect().

◆ testReaderGetPrimaryKey()

BatchRowUpdateTest::testReaderGetPrimaryKey (   $message,
array  $expected,
array  $row 
)

provider_readerGetPrimaryKey

Definition at line 82 of file BatchRowUpdateTest.php.

References mockDb().

◆ testReaderSelectConditionsMultiplePrimaryKeys()

BatchRowUpdateTest::testReaderSelectConditionsMultiplePrimaryKeys (   $message,
  $expectedSecondIteration,
  $primaryKeys,
  $batchSize = 3 
)

Slightly hackish to use reflection, but asserting different parameters to consecutive calls of Database::select in phpunit is error prone.

provider_readerSelectConditions

Definition at line 171 of file BatchRowUpdateTest.php.

References genSelectResult(), and mockDbConsecutiveSelect().

◆ testReaderSetFetchColumns()

BatchRowUpdateTest::testReaderSetFetchColumns (   $message,
array  $columns,
array  $primaryKeys,
array  $fetchColumns 
)

provider_readerSetFetchColumns

Definition at line 126 of file BatchRowUpdateTest.php.

References mockDb().

◆ testWriterBasicFunctionality()

BatchRowUpdateTest::testWriterBasicFunctionality ( )

Definition at line 14 of file BatchRowUpdateTest.php.

References mockDb().


The documentation for this class was generated from the following file: