File tree Expand file tree Collapse file tree 3 files changed +49
-2
lines changed
tests/Functional/tests/Php5_3 Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function process(\TestDbAcle\Psv\PsvTree $tableList)
3434
3535 public function processTable (\TestDbAcle \Psv \Table \Table $ table )
3636 {
37- if (!$ table ->getMeta ()->isReplaceMode ()){
37+ if (!$ table ->getMeta ()->isReplaceMode () && ! $ table -> getMeta ()-> isAppendMode () ){
3838 $ this ->pdoFacade ->clearTable ($ table ->getName ());
3939 }
4040 foreach ($ table ->toArray () as $ valuesToBeInserted ) {
Original file line number Diff line number Diff line change @@ -37,7 +37,12 @@ public function isReplaceMode()
3737 {
3838 return $ this ->getAttribute ('mode ' ) == 'replace ' ;
3939 }
40-
40+
41+ public function isAppendMode ()
42+ {
43+ return $ this ->getAttribute ('mode ' ) == 'append ' ;
44+ }
45+
4146 public function getIdentifyColumns ()
4247 {
4348 return (array ) $ this ->getAttribute ('identifiedBy ' , array ());
Original file line number Diff line number Diff line change @@ -86,6 +86,48 @@ function test_simpleSetupAndAssertTableStateContains()
8686 }
8787
8888 }
89+
90+ /**
91+ * @covers \TestDbAcle\Commands\FilterTableStateByPsvCommand::execute()
92+ * @covers \TestDbAcle\Commands\FilterTableStateByPsvCommand::FilterTableStateByPsvCommand()
93+ * @covers \TestDbAcle\Commands\FilterTableStateByPsvCommand::SetAutoIncrementCommand()
94+ * @covers \TestDbAcle::getDefaultFactories()
95+ */
96+ function test_SetupCanAppendData ()
97+ {
98+
99+ $ this ->setupTables ("
100+ [address]
101+ address_id |company
102+ 1 |me
103+ 3 |you
104+
105+ [user]
106+ user_id |name
107+ 1 |mary
108+
109+ " );
110+
111+
112+ $ this ->setupTables ("
113+ [address|mode:append]
114+ company |city
115+ them |london
116+
117+ " );
118+
119+ $ this ->assertTableStateContains ("
120+ [address]
121+ address_id |company |city
122+ 1 |me |T #T is the default for non-null text
123+ 3 |you |T
124+ 4 |them |london
125+
126+ [user]
127+ user_id |name
128+ 1 |mary
129+ " , array ('NOW ' =>date ("Y-m-d " )));
130+ }
89131
90132 /**
91133 * @covers \TestDbAcle\Commands\FilterTableStateByPsvCommand::execute()
You can’t perform that action at this time.
0 commit comments